fix(monitor): safely get status of previous beat if first beat

This commit is contained in:
Bert Verhelst 2021-10-16 11:28:03 +02:00
parent 176fa6b60d
commit 1d63dd9ddd

View file

@ -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