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 <newtwen+github@gmail.com>
This commit is contained in:
Paul Donald
2026-01-17 16:58:26 +01:00
parent f894913007
commit b5cb136860

View File

@@ -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;
},