From 4ffb8d3136658aee902589dedf2e4bdffdf1df97 Mon Sep 17 00:00:00 2001 From: M00rish Date: Sat, 5 Oct 2024 22:38:58 +0200 Subject: [PATCH] a little refactor --- src/libs/actions/IOU.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 85645fe8ca99..de5b28c0a93b 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -6918,9 +6918,9 @@ function canApproveIOU(iouReport: OnyxTypes.OnyxInputOrEntry, const iouSettled = ReportUtils.isSettled(iouReport?.reportID); const reportNameValuePairs = ReportUtils.getReportNameValuePairs(iouReport?.reportID); const isArchivedReport = ReportUtils.isArchivedRoom(iouReport, reportNameValuePairs); - const unheldTotalIsZero = iouReport?.unheldTotal === 0; + const unheldTotalIsZero = iouReport && iouReport.unheldTotal === 0; - return isCurrentUserManager && !isOpenExpenseReport && !isApproved && !iouSettled && !isArchivedReport && !unheldTotalIsZero && iouReport != null; + return isCurrentUserManager && !isOpenExpenseReport && !isApproved && !iouSettled && !isArchivedReport && !unheldTotalIsZero; } function canIOUBePaid(