mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-27 03:39:39 +03:00
Fix UI crash when torrent is in non-existent category.
This checks that `category_list[categoryHash].torrents` is truthy before dereferencing it. In some cases the API response will have a torrent in a category that doesn't exist resulting in the check to return `undefined` which is not `null`. This broadens the check so that it will create the category even if null. PR #16432.
This commit is contained in:
parent
b3f5bf1583
commit
37e6a9ebc2
1 changed files with 1 additions and 1 deletions
|
@ -320,7 +320,7 @@ window.addEvent('load', function() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
const categoryHash = genHash(category);
|
const categoryHash = genHash(category);
|
||||||
if (category_list[categoryHash] === null) // This should not happen
|
if (!category_list[categoryHash]) // This should not happen
|
||||||
category_list[categoryHash] = {
|
category_list[categoryHash] = {
|
||||||
name: category,
|
name: category,
|
||||||
torrents: []
|
torrents: []
|
||||||
|
|
Loading…
Reference in a new issue