luci-app-adblock: fix the report initialization
authorDirk Brenken <[email protected]>
Fri, 30 May 2025 20:28:31 +0000 (22:28 +0200)
committerDirk Brenken <[email protected]>
Fri, 30 May 2025 20:29:09 +0000 (22:29 +0200)
Signed-off-by: Dirk Brenken <[email protected]>
(cherry picked from commit 04d22e68a1f6b059f99ec8093c5a34ba2c7cd2fd)

applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/dnsreport.js

index 07f1ec0da4611f7704a24471d31c20f37ab43ac2..0e3cba1441d80ca6189bb6fdd6d98872d87a70cb 100644 (file)
@@ -245,20 +245,16 @@ return view.extend({
        },
 
        render: function(dnsreport) {
-               let content, notMsg, errMsg;
+               let content=[], notMsg, errMsg;
 
                if (dnsreport) {
                        try {
                                content = JSON.parse(dnsreport[0]);
                        } catch (e) {
-                               content = "";
-                               if (!errMsg) {
-                                       errMsg = true;
-                                       ui.addNotification(null, E('p', _('Unable to parse the report file!')), 'error');
-                               }
+                               content[0] = "";
                        }
                } else {
-                       content = "";
+                       content[0] = "";
                }
 
                var rows_top = [];