Fix the test case that the previous commit added

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2016-02-28 11:10:46 +01:00
parent 923d0b8767
commit a78f2359d1
1 changed files with 8 additions and 6 deletions

View File

@ -337,6 +337,7 @@ local function parse_table(t, leave_empty)
local attributes, widgets = {}, {}
for k,v in pairs(t) do
if type(k) == "number" then
if v then
-- As `ipairs` doesn't always work on sparse tables, update the
-- maximum
if k > max then
@ -344,6 +345,7 @@ local function parse_table(t, leave_empty)
end
widgets[k] = v
end
else
attributes[k] = v
end