From 460128d8fa3562516470e2137684a7eac903631e Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Mon, 17 Aug 2020 10:05:40 -0600 Subject: [PATCH] Fixed an error I found in the console this morning --- src/lib/actions/ActionsReport.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/actions/ActionsReport.js b/src/lib/actions/ActionsReport.js index 693d9bd29890..95f611c990ee 100644 --- a/src/lib/actions/ActionsReport.js +++ b/src/lib/actions/ActionsReport.js @@ -32,10 +32,10 @@ function updateReportWithNewAction(reportID, reportAction) { // written by the user). If the action doesn't exist, then update the unread flag on the report so the user // knows there is a new comment .then((reportHistory) => { - if (!reportHistory[reportAction.sequenceNumber]) { + if (reportHistory && !reportHistory[reportAction.sequenceNumber]) { Ion.merge(`${IONKEYS.REPORT}_${reportID}`, {hasUnread: true}); } - return reportHistory; + return reportHistory || {}; }) // Put the report action from pusher into the history, it's OK to overwrite it if it already exists