瀏覽代碼

🔧: increase code robustness

chenshuai2144 6 年之前
父節點
當前提交
207ce90a51
共有 1 個文件被更改,包括 1 次插入1 次删除
  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