Quellcode durchsuchen

🔧: increase code robustness

chenshuai2144 vor 6 Jahren
Ursprung
Commit
207ce90a51
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      src/components/NoticeIcon/NoticeList.tsx

+ 1 - 1
src/components/NoticeIcon/NoticeList.tsx

@@ -34,7 +34,7 @@ const NoticeList: React.SFC<NoticeIconTabProps> = ({
   viewMoreText,
   showViewMore = false,
 }) => {
-  if (data.length === 0) {
+  if (!data || data.length === 0) {
     return (
       <div className={styles.notFound}>
         <img