diff --git a/src/libs/SearchUIUtils.ts b/src/libs/SearchUIUtils.ts index 630d60bb0e08..2a3d5bc692f1 100644 --- a/src/libs/SearchUIUtils.ts +++ b/src/libs/SearchUIUtils.ts @@ -257,6 +257,11 @@ function getAction(data: OnyxTypes.SearchResults['data'], key: string): SearchTr const transaction = isTransaction ? data[key] : undefined; const report = isTransaction ? data[`${ONYXKEYS.COLLECTION.REPORT}${transaction?.reportID}`] : data[key]; + // Tracked and unreported expenses don't have a report, so we return early. + if (!report) { + return CONST.SEARCH.ACTION_TYPES.VIEW; + } + // We need to check both options for a falsy value since the transaction might not have an error but the report associated with it might // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing if (transaction?.hasError || report.hasError) {