From 35cb444c4b258c216e37ebe7b958d3ce83a5f672 Mon Sep 17 00:00:00 2001 From: aimane-chnaif Date: Wed, 11 Oct 2023 19:54:14 +1000 Subject: [PATCH 1/2] fix crash when first open contact profile page --- 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 b51671341e407..3df72deccefd9 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}`; }, }, }), From b3b23066e9ee3619a562542e3ebf8834328b34af Mon Sep 17 00:00:00 2001 From: aimane-chnaif Date: Wed, 11 Oct 2023 20:15:32 +1000 Subject: [PATCH 2/2] trigger