mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Fixes accesses to possibly nil discovered data
This commit is contained in:
parent
b7f383e656
commit
d3995e36a2
2 changed files with 13 additions and 9 deletions
|
|
@ -1130,6 +1130,10 @@ local function discovery2config(interface_name)
|
|||
local cached = ntop.getCache(getCachedDiscoveryKey(interface_name))
|
||||
local disc = json.decode(cached)
|
||||
|
||||
if isEmptyString(cached) or not disc then
|
||||
return
|
||||
end
|
||||
|
||||
disc["devices"] = ntop.lrangeCache(getCachedDiscoveredDevicesKey(interface_name), 0, -1) or {}
|
||||
for i=1, #disc["devices"] do
|
||||
disc["devices"][i] = json.decode(disc["devices"][i])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue