fix: validateColorHex: cannot read properties of undefined (reading 'length') (#6242)

This commit is contained in:
Nam Vu 2024-07-15 18:26:00 +07:00 committed by GitHub
parent c17a4165c1
commit 68ad9a91b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -109,7 +109,7 @@ const SettingsModal: FC<ISettingsModalProps> = ({
}
const validateColorHex = (hex: string | null) => {
if (hex === null || hex.length === 0)
if (hex === null || hex?.length === 0)
return true
const regex = /#([A-Fa-f0-9]{6})/