fix nil error

fix nil error
This commit is contained in:
tenplus1 2016-05-21 13:01:39 +01:00
parent e1c2c99690
commit f783039892
1 changed files with 2 additions and 2 deletions

View File

@ -82,7 +82,7 @@ function ipnames.save_data()
ipnames.changes = false
local file = io.open(ipnames.file, "w")
for k, v in pairs(ipnames.data) do
if v[2] > 0 then
if v[2] and v[2] > 0 then
file:write(k.."|"..v[1].."|"..v[2].."\n")
else
file:write(k.."|"..v[1].."\n")
@ -111,4 +111,4 @@ function ipnames.save_whitelist()
end
end
io.close(file)
end
end