Skip to content

Commit cd283f4

Browse files
committed
Add optional chaining for attendees map
1 parent 588ef3b commit cd283f4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/hooks/useReportAvatarDetails.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ function useReportAvatarDetails({iouReport, report, action, ...rest}: AvatarDeta
258258
const attendeesIDs = transactions
259259
// If the transaction is a split, then attendees are not present as a property so we need to use a helper function.
260260
?.flatMap<number | undefined>((tr) =>
261-
tr.comment?.attendees?.map((att) => (tr.comment?.source === CONST.IOU.TYPE.SPLIT ? getSplitAuthor(tr, splits) : getPersonalDetailByEmail(att.email)?.accountID)),
261+
tr.comment?.attendees?.map?.((att) => (tr.comment?.source === CONST.IOU.TYPE.SPLIT ? getSplitAuthor(tr, splits) : getPersonalDetailByEmail(att.email)?.accountID)),
262262
)
263263
.filter((accountID) => !!accountID);
264264

0 commit comments

Comments
 (0)