From 6b4e70caa8917e2ad6a8f01395927ccaf56c11f7 Mon Sep 17 00:00:00 2001 From: Vivek Kumar <35863227+techievivek@users.noreply.github.com> Date: Wed, 11 Oct 2023 15:55:03 +0530 Subject: [PATCH] Merge pull request #29277 from aimane-chnaif/fix-29088 fix crash when first open contact profile page (cherry picked from commit de873481d3685bf0ba246e3894b4dcd88ef5b395) --- src/pages/ProfilePage.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/ProfilePage.js b/src/pages/ProfilePage.js index b51671341e40..3df72deccefd 100755 --- a/src/pages/ProfilePage.js +++ b/src/pages/ProfilePage.js @@ -308,10 +308,11 @@ export default compose( report: { key: ({route, session}) => { const accountID = Number(lodashGet(route.params, 'accountID', 0)); - if (Number(session.accountID) === accountID || Session.isAnonymousUser()) { + const reportID = lodashGet(ReportUtils.getChatByParticipants([accountID]), 'reportID', ''); + if (Number(session.accountID) === accountID || Session.isAnonymousUser() || !reportID) { return null; } - return `${ONYXKEYS.COLLECTION.REPORT}${lodashGet(ReportUtils.getChatByParticipants([accountID]), 'reportID', '')}`; + return `${ONYXKEYS.COLLECTION.REPORT}${reportID}`; }, }, }),