Skip to content

Commit 32560ce

Browse files
committed
cover empty string case
1 parent 906ff69 commit 32560ce

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/libs/ReportUtils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4019,7 +4019,8 @@ function canEditFieldOfMoneyRequest(reportAction: OnyxInputOrEntry<ReportAction>
40194019
}
40204020

40214021
if (fieldToEdit === CONST.EDIT_REQUEST_FIELD.REPORT) {
4022-
const isUnreported = transaction?.reportID === CONST.REPORT.UNREPORTED_REPORT_ID;
4022+
// Unreported transaction from OldDot can have the reportID as an empty string
4023+
const isUnreported = !transaction?.reportID || transaction?.reportID === CONST.REPORT.UNREPORTED_REPORT_ID;
40234024
return isUnreported
40244025
? Object.values(allPolicies ?? {}).flatMap((currentPolicy) => getOutstandingReportsForUser(currentPolicy?.id, currentUserAccountID, allReports ?? {})).length > 0
40254026
: getOutstandingReportsForUser(moneyRequestReport?.policyID, moneyRequestReport?.ownerAccountID, allReports ?? {}).length > 1;

0 commit comments

Comments
 (0)