From 381270e307f027886424bb3e91073e6cf25828cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 25 Jul 2023 10:14:03 +0200 Subject: [PATCH] #1052: filter automation null entries after connection issues --- lib/metadataTypes/Automation.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/metadataTypes/Automation.js b/lib/metadataTypes/Automation.js index 3dacf3934..119681b0f 100644 --- a/lib/metadataTypes/Automation.js +++ b/lib/metadataTypes/Automation.js @@ -74,7 +74,9 @@ class Automation extends MetadataType { }) ) : []; - let metadataMap = this.parseResponseBody({ items: details }); + + // * if retrieving some automations fails, a null element would remain in the details-array for each of them that needs to be filtered to prevent it from causing issues elsewhere + let metadataMap = this.parseResponseBody({ items: details.filter(Boolean) }); if (Object.keys(metadataMap).length) { // attach notification information to each automation that has any