OSDN Git Service

luci-base: ui: fix null access in ui.Table.update()
authorJo-Philipp Wich <jo@mein.io>
Sun, 27 Feb 2022 19:33:02 +0000 (20:33 +0100)
committerJo-Philipp Wich <jo@mein.io>
Sun, 27 Feb 2022 19:33:02 +0000 (20:33 +0100)
Fixes: #5702
Fixes: e0e6989a4a ("luci-base: introduce new LuCI.ui.Table class")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/ui.js

index f915afd..5abd3b3 100644 (file)
@@ -3256,7 +3256,7 @@ var UITable = baseclass.extend(/** @lends LuCI.ui.table.prototype */ {
                }
 
                while (rows[++n])
-                       target.removeChild(rows[n]);
+                       this.node.removeChild(rows[n]);
 
                if (placeholder && this.node.firstElementChild === this.node.lastElementChild) {
                        var trow = this.node.appendChild(E('tr', { 'class': 'tr placeholder' })),