From 704af3ee98d028123f3eb1648bc6c010dd835bb1 Mon Sep 17 00:00:00 2001 From: Youssef Lourayad Date: Fri, 20 Oct 2023 01:24:13 +0800 Subject: [PATCH] Add another check to prevent a needless comparison --- src/libs/ReportUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 57416fdeb1a8..fa8765fe2a0c 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -3291,7 +3291,7 @@ function canFlagReportAction(reportAction, reportID) { if (ReportActionsUtils.isWhisperAction(reportAction)) { // Allow flagging welcome message whispers as they can be set by any room creator - if (lodashGet(reportAction, 'originalMessage.html') === report.welcomeMessage && !isCurrentUserAction) { + if (report.welcomeMessage && !isCurrentUserAction && lodashGet(reportAction, 'originalMessage.html') === report.welcomeMessage) { return true; }