mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-10-22 10:46:04 +03: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:
parent
1d221c22e4
commit
8e6515be2c
1 changed files with 7 additions and 4 deletions
|
@ -1400,10 +1400,13 @@ window.qBittorrent.DynamicTable = (function() {
|
|||
return false;
|
||||
}
|
||||
else {
|
||||
const selectedCategoryName = category_list.get(categoryHash).name + "/";
|
||||
const torrentCategoryName = row['full_data'].category + "/";
|
||||
if (!torrentCategoryName.startsWith(selectedCategoryName))
|
||||
return false;
|
||||
const selectedCategory = category_list.get(categoryHash);
|
||||
if (selectedCategory !== undefined) {
|
||||
const selectedCategoryName = selectedCategory.name + "/";
|
||||
const torrentCategoryName = row['full_data'].category + "/";
|
||||
if (!torrentCategoryName.startsWith(selectedCategoryName))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue