From 1d63dd9ddd540b78e6bf6e3f701b31010dc0fd4b Mon Sep 17 00:00:00 2001 From: Bert Verhelst Date: Sat, 16 Oct 2021 11:28:03 +0200 Subject: [PATCH] fix(monitor): safely get status of previous beat if first beat --- server/model/monitor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index 4049a9937..3640c7324 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -304,7 +304,7 @@ class Monitor extends BeanModel { let beatInterval = this.interval; - let isImportant = Monitor.isImportantBeat(isFirstBeat, previousBeat.status, bean.status); + let isImportant = Monitor.isImportantBeat(isFirstBeat, previousBeat?.status, bean.status); // Mark as important if status changed, ignore pending pings, // Don't notify if disrupted changes to up