summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDaniel Dickinson <lede@cshore.thecshore.com>2016-12-29 15:04:57 -0500
committerDaniel Dickinson <lede@cshore.thecshore.com>2016-12-30 13:44:22 -0500
commit7bfd36d5855100fe18a7759644aef697e9d03cee (patch)
treecafc94631484971ba11da9d5b7d2d888f638b70c
parentf12fdba222c87e9a38c8cc4496964ac3fb386f7f (diff)
base: webadmin: Don't take substring of nil variable
When converting interface names to UCI network names webadmin fails if there is no UCI network name because webadmin failed to ensure uciname has a value before attempting to take a substring. Signed-off-by: Daniel Dickinson <lede@cshore.thecshore.com>
-rw-r--r--modules/luci-base/luasrc/tools/webadmin.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/luci-base/luasrc/tools/webadmin.lua b/modules/luci-base/luasrc/tools/webadmin.lua
index 8273175de..106810aa0 100644
--- a/modules/luci-base/luasrc/tools/webadmin.lua
+++ b/modules/luci-base/luasrc/tools/webadmin.lua
@@ -96,7 +96,7 @@ function iface_get_network(iface)
if net.l3_device == iface or net.device == iface then
-- cross check with uci to filter out @name style aliases
local uciname = cur:get("network", net.interface, "ifname")
- if not uciname or uciname:sub(1, 1) ~= "@" then
+ if type(uciname) == "string" and uciname:sub(1,1) ~= "@" or uciname then
return net.interface
end
end