libs/core: fix removal of wifi networks without interface attached (OpenWrt #10400)

This commit is contained in:
Jo-Philipp Wich 2011-11-12 11:27:10 +00:00
parent e50dea1cf7
commit cfe48c17d3

View file

@ -1411,8 +1411,9 @@ function wifinet.adminlink(self)
end
function wifinet.get_network(self)
if _uci_real:get("network", self.iwdata.network) == "interface" then
return network(self.iwdata.network)
local net = tostring(self.iwdata.network)
if net and _uci_real:get("network", net) == "interface" then
return network(net)
end
end