mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-28 23:19:33 +00:00
Add check for nil dump to avoid json decode errors
This commit is contained in:
parent
ee17475cc5
commit
9fe373b880
1 changed files with 5 additions and 0 deletions
|
|
@ -79,7 +79,12 @@ function prefs_dump_utils.readPrefsFromDisk()
|
|||
local dump = file:read()
|
||||
file:close()
|
||||
|
||||
if(dump == nil) then
|
||||
return
|
||||
end
|
||||
|
||||
local json = require("dkjson")
|
||||
|
||||
local restore = json.decode(dump, 1, nil)
|
||||
|
||||
for k,v in pairs(restore or {}) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue