Store network id as uint16 in alerts

This commit is contained in:
Alfredo Cardigliano 2022-04-07 15:51:56 +02:00
parent 61f74ce0a1
commit ff576e5967
3 changed files with 6 additions and 5 deletions

View file

@ -2270,15 +2270,16 @@ end
function getLocalNetworkAliasById(network)
local networks_stats = interface.getNetworksStats()
local network_id = tonumber(network)
-- If network is (u_int8_t)-1 then return an empty value
if network == "65535" then
if network == nil or network == 65535 then
return ' '
end
local label = ''
for n, ns in pairs(networks_stats) do
if ns.network_id == tonumber(network) then
if ns.network_id == network_id then
label = getFullLocalNetworkName(ns.network_key)
end
end