Jelajahi Sumber

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

Nam Vu 9 bulan lalu
induk
melakukan
68ad9a91b2
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      web/app/components/app/overview/settings/index.tsx

+ 1 - 1
web/app/components/app/overview/settings/index.tsx

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