From 93b3424342883c047a4be9b8b7924df62b607e8b Mon Sep 17 00:00:00 2001 From: boatbomber Date: Fri, 8 Nov 2024 17:18:33 -0800 Subject: [PATCH] Guard against invalid text --- plugin/src/App/getTextBoundsAsync.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugin/src/App/getTextBoundsAsync.lua b/plugin/src/App/getTextBoundsAsync.lua index 97893cd8c..12c394bf8 100644 --- a/plugin/src/App/getTextBoundsAsync.lua +++ b/plugin/src/App/getTextBoundsAsync.lua @@ -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