@@ -6185,16 +6185,21 @@ function getAllAncestorReportActions(report: Report | null | undefined): Ancesto
6185
6185
const parentReport = getReport ( parentReportID ) ;
6186
6186
const parentReportAction = ReportActionsUtils . getReportAction ( parentReportID , parentReportActionID ?? '0' ) ;
6187
6187
6188
- if ( ! parentReportAction || ReportActionsUtils . isTransactionThread ( parentReportAction ) || ! parentReport ) {
6188
+ if ( ! parentReportAction || ReportActionsUtils . isTransactionThread ( parentReportAction ) ) {
6189
6189
break ;
6190
6190
}
6191
6191
6192
- const isParentReportActionUnread = ReportActionsUtils . isCurrentActionUnread ( parentReport , parentReportAction ) ;
6192
+ const isParentReportActionUnread = ReportActionsUtils . isCurrentActionUnread ( parentReport ?? { } , parentReportAction ) ;
6193
6193
allAncestors . push ( {
6194
6194
report : currentReport ,
6195
6195
reportAction : parentReportAction ,
6196
6196
shouldDisplayNewMarker : isParentReportActionUnread ,
6197
6197
} ) ;
6198
+
6199
+ if ( ! parentReport ) {
6200
+ break ;
6201
+ }
6202
+
6198
6203
parentReportID = parentReport ?. parentReportID ;
6199
6204
parentReportActionID = parentReport ?. parentReportActionID ;
6200
6205
if ( ! isEmptyObject ( parentReport ) ) {
@@ -6224,13 +6229,17 @@ function getAllAncestorReportActionIDs(report: Report | null | undefined, includ
6224
6229
const parentReport = getReport ( parentReportID ) ;
6225
6230
const parentReportAction = ReportActionsUtils . getReportAction ( parentReportID , parentReportActionID ?? '0' ) ;
6226
6231
6227
- if ( ! parentReportAction || ( ! includeTransactionThread && ReportActionsUtils . isTransactionThread ( parentReportAction ) ) || ! parentReport ) {
6232
+ if ( ! parentReportAction || ( ! includeTransactionThread && ReportActionsUtils . isTransactionThread ( parentReportAction ) ) ) {
6228
6233
break ;
6229
6234
}
6230
6235
6231
6236
allAncestorIDs . reportIDs . push ( parentReportID ?? '' ) ;
6232
6237
allAncestorIDs . reportActionsIDs . push ( parentReportActionID ?? '' ) ;
6233
6238
6239
+ if ( ! parentReport ) {
6240
+ break ;
6241
+ }
6242
+
6234
6243
parentReportID = parentReport ?. parentReportID ;
6235
6244
parentReportActionID = parentReport ?. parentReportActionID ;
6236
6245
}
0 commit comments