luci-base: iface_get_network(): fix condition
authorJo-Philipp Wich <jo@mein.io>
Tue, 3 Mar 2020 19:36:54 +0000 (20:36 +0100)
committerJo-Philipp Wich <jo@mein.io>
Tue, 3 Mar 2020 19:36:54 +0000 (20:36 +0100)
Fixes: #3715
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/luasrc/tools/webadmin.lua

index 106810aa03e44e6ac1fa22dd0af436d4b821fbeb..8801b86fe38c9ad03105401eec761d9ebacf34ee 100644 (file)
@@ -96,7 +96,9 @@ 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 type(uciname) == "string" and uciname:sub(1,1) ~= "@" or uciname then
+                               if (type(uciname) == "string" and uciname:sub(1,1) ~= "@") or
+                                  (type(uciname) == "table")
+                               then
                                        return net.interface
                                end
                        end