mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 06:01:33 -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,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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user