Skip to content

Commit

Permalink
fix: pcall metadata in case it isn't a hex color
Browse files Browse the repository at this point in the history
  • Loading branch information
unrooot committed Nov 14, 2024
1 parent f23602e commit 0c6df93
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ function ChatProviderServiceClient:Start()

local metadata = textChatMessage.Metadata
if metadata then
local isValidColor = Color3.fromHex(metadata)
local isValidColor = pcall(function()
return Color3.fromHex(metadata)
end)

if isValidColor then
local overrideProperties = Instance.new("TextChatMessageProperties")
overrideProperties.Text = `<font color="#{metadata}">{textChatMessage.Text}</font>`
Expand Down

0 comments on commit 0c6df93

Please sign in to comment.