From: Paul Donald Date: Sat, 17 Jan 2026 15:58:26 +0000 (+0100) Subject: luci-base: fix null error X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=b5cb13686034e2d463078e984351a28f8bb9c752;p=openwrt-luci.git luci-base: fix null error When working with JSONMap backed data sources in tables, sort triggers a null error because this.state is not available. Prevent the null error if it is unavailable. Signed-off-by: Paul Donald --- diff --git a/modules/luci-base/htdocs/luci-static/resources/uci.js b/modules/luci-base/htdocs/luci-static/resources/uci.js index c0b5e97be0..16baebda5f 100644 --- a/modules/luci-base/htdocs/luci-static/resources/uci.js +++ b/modules/luci-base/htdocs/luci-static/resources/uci.js @@ -871,7 +871,8 @@ return baseclass.extend(/** @lends LuCI.uci.prototype */ { for (let i = 0; i < sa.length; i++) this.get(conf, sa[i]['.name'])['.index'] = i; - this.state.reorder[conf] = true; + if (this.state) + this.state.reorder[conf] = true; return true; },