diff --git a/src/pages/ProfilePage.js b/src/pages/ProfilePage.js index e97975b0481b9..6b851bf9e5b27 100755 --- a/src/pages/ProfilePage.js +++ b/src/pages/ProfilePage.js @@ -101,7 +101,6 @@ const getPhoneNumber = (details) => { function ProfilePage(props) { const accountID = Number(lodashGet(props.route.params, 'accountID', 0)); - const details = lodashGet(props.personalDetails, accountID, ValidationUtils.isValidAccountRoute(accountID) ? {} : {isloading: false}); const displayName = details.displayName ? details.displayName : props.translate('common.hidden'); @@ -298,14 +297,11 @@ export default compose( session: { key: ONYXKEYS.SESSION, }, - }), - // eslint-disable-next-line rulesdir/no-multiple-onyx-in-file - withOnyx({ report: { key: ({route, session}) => { const accountID = Number(lodashGet(route.params, 'accountID', 0)); const reportID = lodashGet(ReportUtils.getChatByParticipants([accountID]), 'reportID', ''); - if (Number(session.accountID) === accountID || Session.isAnonymousUser() || !reportID) { + if ((session && Number(session.accountID) === accountID) || Session.isAnonymousUser() || !reportID) { return null; } return `${ONYXKEYS.COLLECTION.REPORT}${reportID}`;