From a78f2359d1ed2ba6b5bc472b21fc5b49b619174b Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 28 Feb 2016 11:10:46 +0100 Subject: [PATCH] Fix the test case that the previous commit added Signed-off-by: Uli Schlachter --- lib/wibox/widget/base.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/wibox/widget/base.lua b/lib/wibox/widget/base.lua index 561e446b..8e9b388d 100644 --- a/lib/wibox/widget/base.lua +++ b/lib/wibox/widget/base.lua @@ -337,13 +337,15 @@ local function parse_table(t, leave_empty) local attributes, widgets = {}, {} for k,v in pairs(t) do if type(k) == "number" then - -- As `ipairs` doesn't always work on sparse tables, update the - -- maximum - if k > max then - max = k - end + if v then + -- As `ipairs` doesn't always work on sparse tables, update the + -- maximum + if k > max then + max = k + end - widgets[k] = v + widgets[k] = v + end else attributes[k] = v end