mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Don't crash when sizeUtf8Text is called on a nil
By returning a table with the right fields instead of nil. Re #4845
This commit is contained in:
@@ -157,7 +157,7 @@ end
|
||||
function RenderText:sizeUtf8Text(x, width, face, text, kerning, bold)
|
||||
if not text then
|
||||
logger.warn("sizeUtf8Text called without text");
|
||||
return
|
||||
return { x = 0, y_top = 0, y_bottom = 0 }
|
||||
end
|
||||
|
||||
-- may still need more adaptive pen placement when kerning,
|
||||
|
||||
Reference in New Issue
Block a user