From b3cc9945d7ad1d51713b5445ced15bf574ca8a8b Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Fri, 3 Nov 2023 08:21:02 +0000 Subject: [PATCH] Merge pull request #30816 from bernhardoj/fix/30804-can't-create-sub-task [CP Staging] Fix there is no assign task option on a task report (cherry picked from commit 4322ad90ec20ca841179ff8fb94d5e54e6666eb9) --- src/libs/ReportUtils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 10630d7fb122..bec494b2e44b 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -533,7 +533,8 @@ function isExpensifyOnlyParticipantInReport(report) { */ function canCreateTaskInReport(report) { const otherReportParticipants = _.without(lodashGet(report, 'participantAccountIDs', []), currentUserAccountID); - const areExpensifyAccountsOnlyOtherParticipants = _.every(otherReportParticipants, (accountID) => _.contains(CONST.EXPENSIFY_ACCOUNT_IDS, accountID)); + const areExpensifyAccountsOnlyOtherParticipants = + otherReportParticipants.length >= 1 && _.every(otherReportParticipants, (accountID) => _.contains(CONST.EXPENSIFY_ACCOUNT_IDS, accountID)); if (areExpensifyAccountsOnlyOtherParticipants && isDM(report)) { return false; }