Skip to content

Commit 95ba3a2

Browse files
MelvinBotdukenv0307
andcommitted
Fix: use truthiness check for parentReportIDForUpdate to handle undefined parentReport
When parentReport is undefined (originalReport is falsy in caller), parentReport?.reportID !== reportID evaluates to true (undefined !== string), causing parentReportIDForUpdate to be assigned undefined instead of falling through to report?.parentReportID. Co-authored-by: dukenv0307 <dukenv0307@users.noreply.github.com>
1 parent d17041b commit 95ba3a2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/libs/actions/Report/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5509,7 +5509,7 @@ function resolveActionableMentionWhisper(
55095509
}
55105510
let parentReportIDForUpdate: string | undefined;
55115511
if (parentInviteData) {
5512-
parentReportIDForUpdate = parentReport?.reportID !== reportID ? parentReport?.reportID : report?.parentReportID;
5512+
parentReportIDForUpdate = parentReport?.reportID && parentReport.reportID !== reportID ? parentReport.reportID : report?.parentReportID;
55135513
}
55145514
const parentParticipantsOptimisticData = parentInviteData?.optimistic;
55155515
const parentParticipantsFailureData = parentInviteData?.failure;

0 commit comments

Comments
 (0)