From cd5dda385e37aa7f4bd45d6dc0f69eb281593741 Mon Sep 17 00:00:00 2001 From: Aire-One Date: Thu, 11 Nov 2021 19:28:49 +0100 Subject: [PATCH] fix(w.w.template) draw The draw method exists only for widgets. When dealing with more complex widget, this method is not necessary implemented (i.e. with layouts). We need to check the method is defined by the child before calling it. --- lib/wibox/widget/template.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/wibox/widget/template.lua b/lib/wibox/widget/template.lua index a64f4940d..875f1c3de 100644 --- a/lib/wibox/widget/template.lua +++ b/lib/wibox/widget/template.lua @@ -40,7 +40,9 @@ function template:fit(context, width, height) end function template:draw(...) - return self._private.widget:draw(...) + if type(self._private.widget.draw) == "function" then + return self._private.widget:draw(...) + end end function template:_do_update_now()