Prevent error when data is outside of a section

Which is now picked up as a parse error and returned.
This commit is contained in:
Bart van Strien 2021-07-26 13:59:59 +02:00
parent 149af030cd
commit 274bb1e0ce

View File

@ -90,7 +90,7 @@ function inifile.parse(name, backend)
if tonumber(value) then value = tonumber(value) end
if value == "true" then value = true end
if value == "false" then value = false end
if key and value ~= nil then
if key and value ~= nil and section ~= nil then
t[section][key] = value
table.insert(cursectionorder, key)
validLine = true