From c7c9e37c998f314fadd939d11febe6dd5a91bea2 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Fri, 31 Dec 2021 14:25:43 +0100 Subject: [PATCH] fix: fail if a label is absent --- sonic-radiance.love/birb/modules/gui/menus/widgets/text.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sonic-radiance.love/birb/modules/gui/menus/widgets/text.lua b/sonic-radiance.love/birb/modules/gui/menus/widgets/text.lua index 5d784dd..7809d04 100644 --- a/sonic-radiance.love/birb/modules/gui/menus/widgets/text.lua +++ b/sonic-radiance.love/birb/modules/gui/menus/widgets/text.lua @@ -40,8 +40,9 @@ end function TextWidget:addLabel(label, position) local complexLabel = {} + assert(label ~= nil, "Label can't be nil") complexLabel.label = label - complexLabel.position = position + complexLabel.position = position or "left" table.insert(self.labels, complexLabel) end