From 71f43d8da74355f2bf08ad8783a2ff7c79f803e6 Mon Sep 17 00:00:00 2001 From: xiaorouji <60100640+xiaorouji@users.noreply.github.com> Date: Wed, 13 Sep 2023 13:51:29 +0800 Subject: [PATCH] luci: fix nil value error --- .../luasrc/model/cbi/passwall2/client/global.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/global.lua b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/global.lua index 1c6fe11b8..a82cd965b 100644 --- a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/global.lua +++ b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/global.lua @@ -270,9 +270,11 @@ o.rows = 5 o.wrap = "off" o.remove = function(self, section) local node_value = node:formvalue(global_cfgid) - local node_t = m:get(node_value) - if node_t.type == "Xray" then - AbstractValue.remove(self, section) + if node_value ~= "nil" then + local node_t = m:get(node_value) or {} + if node_t.type == "Xray" then + AbstractValue.remove(self, section) + end end end