Add check for nil dump to avoid json decode errors

This commit is contained in:
emanuele-f 2020-03-17 18:22:48 +01:00
parent ee17475cc5
commit 9fe373b880

View file

@ -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