mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 00:06:16 -07:00
Fix WebUI crash due to missing tags from config
Tags can be missing from config but set inside .fastresume. May happen due to corrupted/deleted config. Closes #11906. PR #16711.
This commit is contained in:
parent
4ca6de2b54
commit
11cfe38d1c
1 changed files with 6 additions and 0 deletions
|
@ -374,6 +374,12 @@ window.addEvent('load', function() {
|
||||||
let added = false;
|
let added = false;
|
||||||
for (let i = 0; i < tags.length; ++i) {
|
for (let i = 0; i < tags.length; ++i) {
|
||||||
const tagHash = genHash(tags[i].trim());
|
const tagHash = genHash(tags[i].trim());
|
||||||
|
if (!tagList[tagHash]) { // This should not happen
|
||||||
|
tagList[tagHash] = {
|
||||||
|
name: tags,
|
||||||
|
torrents: []
|
||||||
|
};
|
||||||
|
}
|
||||||
if (!Object.contains(tagList[tagHash].torrents, torrent['hash'])) {
|
if (!Object.contains(tagList[tagHash].torrents, torrent['hash'])) {
|
||||||
added = true;
|
added = true;
|
||||||
tagList[tagHash].torrents.push(torrent['hash']);
|
tagList[tagHash].torrents.push(torrent['hash']);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue