mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 14:08:03 -06:00
WebUI: Fix error when category doesn't exist
This prevents hitting a TypeError when the category stored in localstorage does not exist. The behavior for a nonexistent category now mirrors that of a nonexistent tag or filter - no option is selected and no torrents are shown. Closes #20623. PR #20638.
This commit is contained in:
committed by
GitHub
parent
1d221c22e4
commit
8e6515be2c
@@ -1400,11 +1400,14 @@ window.qBittorrent.DynamicTable = (function() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const selectedCategoryName = category_list.get(categoryHash).name + "/";
|
const selectedCategory = category_list.get(categoryHash);
|
||||||
|
if (selectedCategory !== undefined) {
|
||||||
|
const selectedCategoryName = selectedCategory.name + "/";
|
||||||
const torrentCategoryName = row['full_data'].category + "/";
|
const torrentCategoryName = row['full_data'].category + "/";
|
||||||
if (!torrentCategoryName.startsWith(selectedCategoryName))
|
if (!torrentCategoryName.startsWith(selectedCategoryName))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user