Browse Source

🔧: increase code robustness

chenshuai2144 6 năm trước cách đây
mục cha
commit
207ce90a51
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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