fixed type error

This commit is contained in:
Samuel Philipp 2020-02-27 19:35:37 +01:00
parent 0d4e6c6f80
commit 67b41fb91a

View file

@ -120,7 +120,7 @@ const check = async () => {
for (const service of config.services) {
const oldStatus = cache[service.id];
const newStatus = await checkService(service, oldStatus);
if (oldStatus.status !== newStatus.status) {
if (!oldStatus || oldStatus.status !== newStatus.status) {
console.log(service.id + ' status changed: ' + newStatus.status);
await pushStatusToCachet(service.id, newStatus.status);
cache[service.id] = newStatus;