diff --git a/src/components/GlobalHeader/index.js b/src/components/GlobalHeader/index.js index 10aea499571a8bda432859c8680f291c4a3590b2..0f405f7bda25f77991dcce06f7aa24cefefbd9a0 100644 --- a/src/components/GlobalHeader/index.js +++ b/src/components/GlobalHeader/index.js @@ -13,8 +13,8 @@ export default class GlobalHeader extends PureComponent { this.triggerResizeEvent.cancel(); } getNoticeData() { - const { notices = [] } = this.props; - if (notices.length === 0) { + const { notices} = this.props; + if (notices == null || notices.length === 0) { return {}; } const newNotices = notices.map(notice => { @@ -66,6 +66,9 @@ export default class GlobalHeader extends PureComponent { onMenuClick, onNoticeClear, } = this.props; + if (currentUser == null) { + currentUser = {} + } const menu = (