mirror of
https://github.com/c0re100/qBittorrent-Enhanced-Edition.git
synced 2025-01-08 11:57:51 +08: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 #16739. Original PR #16711.
This commit is contained in:
parent
c621cae43b
commit
c1b38221d2
@ -361,6 +361,12 @@ window.addEvent('load', function() {
|
||||
let added = false;
|
||||
for (let i = 0; i < tags.length; ++i) {
|
||||
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'])) {
|
||||
added = true;
|
||||
tagList[tagHash].torrents.push(torrent['hash']);
|
||||
|
Loading…
Reference in New Issue
Block a user