diff options
author | Stan Grishin <stangri@melmac.ca> | 2024-02-04 01:46:22 +0000 |
---|---|---|
committer | Stan Grishin <stangri@melmac.ca> | 2024-02-04 01:46:22 +0000 |
commit | 00960d522d3ee296db58960560a177fd8e6a688a (patch) | |
tree | b7228663fda877fc786b2f15f31234233105432a /applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js | |
parent | 1e1c6b853157febd3d93cdcbaa059a4f1a80b33b (diff) |
luci-app-adblock-fast: bugfix: prevent runtime errors on empty warning/messages
Signed-off-by: Stan Grishin <stangri@melmac.ca>
Diffstat (limited to 'applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js')
-rw-r--r-- | applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js b/applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js index 703eb4ff7b..1040cfb369 100644 --- a/applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js +++ b/applications/luci-app-adblock-fast/htdocs/luci-static/resources/adblock-fast/status.js @@ -201,8 +201,11 @@ var status = baseclass.extend({ ); var text = ""; reply.status.warnings.forEach((element) => { - text += - warningTable[element.id].format(element.extra || " ") + "<br />"; + if (element.id && warningTable[element.id]) + text += + warningTable[element.id].format(element.extra || " ") + + "<br />"; + else text += _("Unknown warning") + "<br />"; }); var warningsText = E("div", {}, text); var warningsField = E( @@ -292,8 +295,10 @@ var status = baseclass.extend({ ); var text = ""; reply.status.errors.forEach((element) => { - text += - errorTable[element.id].format(element.extra || " ") + "!<br />"; + if (element.id && errorTable[element.id]) + text += + errorTable[element.id].format(element.extra || " ") + "!<br />"; + else text += _("Unknown error") + "<br />"; }); text += _("Errors encountered, please check the %sREADME%s").format( '<a href="' + pkg.URL + '" target="_blank">', |