mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 07:59:35 +00:00
Add checks for possibly nil host
This commit is contained in:
parent
35e1ce162c
commit
dbeabadbe6
1 changed files with 5 additions and 3 deletions
|
|
@ -245,11 +245,13 @@ for _key, _value in pairsByKeys(vals, funct) do
|
|||
end
|
||||
|
||||
local icon = getOSIcon(value["os"])
|
||||
icon = icon .." ".. discover.devtype2icon(host.devtype)
|
||||
if(host ~= nil) then
|
||||
icon = icon .." ".. discover.devtype2icon(host.devtype)
|
||||
end
|
||||
icon = icon:gsub('"',"'")
|
||||
column_ip = column_ip .. icon
|
||||
|
||||
if((host.ip ~= "0.0.0.0") and (not string.contains(host.ip, ":"))) then
|
||||
if((host ~= nil) and (host.ip ~= "0.0.0.0") and (not string.contains(host.ip, ":"))) then
|
||||
if(value.dhcpHost) then column_ip = column_ip .. " <i class='fa fa-flash fa-lg' title='DHCP Host'></i>" end
|
||||
end
|
||||
|
||||
|
|
@ -336,7 +338,7 @@ for _key, _value in pairsByKeys(vals, funct) do
|
|||
.."<span class='label label-info'>"..i18n("flows").."</span>"
|
||||
.."</a>"
|
||||
|
||||
if have_nedge and (host.localhost or host.systemhost) then
|
||||
if have_nedge and (host ~= nil) and (host.localhost or host.systemhost) then
|
||||
column_info = column_info.." <span title='"..
|
||||
(ternary(drop_traffic, i18n("host_config.unblock_host_traffic"), i18n("host_config.drop_all_host_traffic")))..
|
||||
"' class='label label-"..(ternary(drop_traffic, "danger", "default")).." block-badge' "..
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue