Skip to content

Commit

Permalink
Merge pull request #34648 from abzokhattab/fix-accessing-undefined-re…
Browse files Browse the repository at this point in the history
…port-action-error

Fix accessing undefined parentReportActions object when loading the transactions
  • Loading branch information
cristipaval authored Jan 22, 2024
2 parents 1d21e28 + 303ee2c commit 5e71037
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/ReportActionItem/MoneyRequestView.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ export default compose(
withOnyx({
transaction: {
key: ({report, parentReportActions}) => {
const parentReportAction = parentReportActions[report.parentReportActionID];
const parentReportAction = lodashGet(parentReportActions, [report.parentReportActionID]);
const transactionID = lodashGet(parentReportAction, ['originalMessage', 'IOUTransactionID'], 0);
return `${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`;
},
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/ReportScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ export default compose(
if (!parentReportActionID) {
return {};
}
return parentReportActions[parentReportActionID];
return lodashGet(parentReportActions, parentReportActionID);
},
canEvict: false,
},
Expand Down

0 comments on commit 5e71037

Please sign in to comment.