Browse Source

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.
adaptive-webui-19844
An0n 3 years ago committed by GitHub
parent
commit
11cfe38d1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/webui/www/private/scripts/client.js

6
src/webui/www/private/scripts/client.js

@ -374,6 +374,12 @@ window.addEvent('load', function() { @@ -374,6 +374,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…
Cancel
Save