fix: fail if a label is absent

This commit is contained in:
Kazhnuz 2021-12-31 14:25:43 +01:00
parent 7ca60da3fd
commit c7c9e37c99

View file

@ -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