TextBoxWidget: fix crash in legacy mode (#8545)

Just do as in _measureWithXText(): convert to
string when text is not (ie. a number).
reviewable/pr8546/r1
poire-z 3 years ago committed by GitHub
parent 3deac02b71
commit 5ed22cafb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -216,6 +216,11 @@ end
function TextBoxWidget:_evalCharWidthList()
-- if self.charlist is provided, use it directly
if self.charlist == nil then
if not self.text then
self.text = ""
elseif type(self.text) ~= "string" then
self.text = tostring(self.text)
end
self.charlist = util.splitToChars(self.text)
end
-- get width of each distinct char

Loading…
Cancel
Save