From: Andy Chiang Date: Mon, 11 May 2026 06:52:21 +0000 (+0700) Subject: luci-base: fix "null" text appearing in modal X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=7b02b9add5bff7e321f63a82e883f770f9e2f327;p=openwrt-luci.git luci-base: fix "null" text appearing in modal fix "null" text appearing in modal UPDATE: added {} in for-loop for readability - CK Signed-off-by: Andy Chiang --- diff --git a/modules/luci-base/htdocs/luci-static/resources/luci.js b/modules/luci-base/htdocs/luci-static/resources/luci.js index 5649d07e77..68852e47b6 100644 --- a/modules/luci-base/htdocs/luci-static/resources/luci.js +++ b/modules/luci-base/htdocs/luci-static/resources/luci.js @@ -1376,11 +1376,12 @@ return null; if (Array.isArray(children)) { - for (let i = 0; i < children.length; i++) + for (let i = 0; i < children.length; i++) { if (this.elem(children[i])) node.appendChild(children[i]); - else if (children !== null && children !== undefined) + else if (children[i] !== null && children[i] !== undefined) node.appendChild(document.createTextNode(`${children[i]}`)); + } return node.lastChild; } diff --git a/modules/luci-base/htdocs/luci-static/resources/ui.js b/modules/luci-base/htdocs/luci-static/resources/ui.js index 2952ffe0cd..b21b365d7b 100644 --- a/modules/luci-base/htdocs/luci-static/resources/ui.js +++ b/modules/luci-base/htdocs/luci-static/resources/ui.js @@ -4993,7 +4993,7 @@ const UI = baseclass.extend(/** @lends LuCI.ui.prototype */ { if (info) infoNode = E('p', _('%s').format(info)); - UI.prototype.showModal(_('Uploading file…'), [ progress, infoNode ? infoNode : null ]); + UI.prototype.showModal(_('Uploading file…'), [ progress, infoNode ]); const data = new FormData();