Просмотр исходного кода

🐛 bug: more robust code judgment

chenshuai2144 5 лет назад
Родитель
Сommit
b005f2a465
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/components/GlobalHeader/NoticeIconView.tsx

+ 1 - 1
src/components/GlobalHeader/NoticeIconView.tsx

@@ -57,7 +57,7 @@ class GlobalHeaderRight extends Component<GlobalHeaderRightProps> {
   } => {
     const { notices = [] } = this.props;
 
-    if (!notices || notices.length === 0) {
+    if (!notices || notices.length === 0 || !Array.isArray(notices)) {
       return {};
     }