Merge pull request #930 from cshore-firmware/pull-request-fix-webadmin

base: webadmin: Don't take substring of nil variable
This commit is contained in:
Daniel Dickinson 2017-01-10 17:19:55 -05:00 committed by GitHub
commit 6c13339ad3

View file

@ -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