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