Commit 43a570da authored by Amumu's avatar Amumu Committed by 偏右

For robustness

close #1661
parent 2465ac2c
...@@ -13,8 +13,8 @@ export default class GlobalHeader extends PureComponent { ...@@ -13,8 +13,8 @@ export default class GlobalHeader extends PureComponent {
this.triggerResizeEvent.cancel(); this.triggerResizeEvent.cancel();
} }
getNoticeData() { getNoticeData() {
const { notices = [] } = this.props; const { notices} = this.props;
if (notices.length === 0) { if (notices == null || notices.length === 0) {
return {}; return {};
} }
const newNotices = notices.map(notice => { const newNotices = notices.map(notice => {
...@@ -66,6 +66,9 @@ export default class GlobalHeader extends PureComponent { ...@@ -66,6 +66,9 @@ export default class GlobalHeader extends PureComponent {
onMenuClick, onMenuClick,
onNoticeClear, onNoticeClear,
} = this.props; } = this.props;
if (currentUser == null) {
currentUser = {}
}
const menu = ( const menu = (
<Menu className={styles.menu} selectedKeys={[]} onClick={onMenuClick}> <Menu className={styles.menu} selectedKeys={[]} onClick={onMenuClick}>
<Menu.Item disabled> <Menu.Item disabled>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment