diff --git a/lib/shared/mention-utils.js b/lib/shared/mention-utils.js --- a/lib/shared/mention-utils.js +++ b/lib/shared/mention-utils.js @@ -1,7 +1,5 @@ // @flow -import invariant from 'invariant'; - import { oldValidUsernameRegexString } from './account-utils.js'; import SearchIndex from './search-index.js'; import { threadOtherMembers } from './thread-utils.js'; @@ -102,8 +100,13 @@ if (threadInfo.type !== threadTypes.SIDEBAR) { return threadInfo.members; } - invariant(parentThreadInfo, 'sidebars should have parents'); - return parentThreadInfo.members; + if (parentThreadInfo) { + return parentThreadInfo.members; + } + // This scenario should not occur unless the user logs out while looking at a + // sidebar. In that scenario, the Redux store may be cleared before ReactNav + // finishes transitioning away from the previous screen + return []; } export {