소스 검색

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

Nam Vu 1 년 전
부모
커밋
68ad9a91b2
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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) => {
-      if (hex === null || hex.length === 0)
+      if (hex === null || hex?.length === 0)
         return true
 
       const regex = /#([A-Fa-f0-9]{6})/