Skip to content

Commit

Permalink
Guard against invalid text
Browse files Browse the repository at this point in the history
  • Loading branch information
boatbomber committed Nov 9, 2024
1 parent e8e7fd1 commit 93b3424
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugin/src/App/getTextBoundsAsync.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ local function getTextBoundsAsync(
width: number,
richText: boolean?
): Vector2
if type(text) ~= "string" or #text > 200_000 then
Log.warn(`Invalid text: {text}`)
return Vector2.zero
end

params.Text = text
params.Font = font
params.Size = textSize
Expand Down

0 comments on commit 93b3424

Please sign in to comment.