1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Fix if device not yet exist

This commit is contained in:
Ycarus (Yannick Chabanois) 2019-12-11 20:07:00 +01:00
parent c428d8a9ba
commit 3d7002f88c

View file

@ -736,7 +736,11 @@ end
function get_device(interface)
local dump = require("luci.util").ubus("network.interface.%s" % interface, "status", {})
return dump['l3_device']
if dump ~= nil then
return dump['l3_device']
else
return ""
end
end
-- This function come from modules/luci-bbase/luasrc/tools/status.lua from old OpenWrt