From: Jérôme Benoit Date: Thu, 27 Oct 2022 19:46:26 +0000 (+0200) Subject: Check for null or undefined in isEmptyObject() X-Git-Tag: v1.1.87~23 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=d20581eee9c09db9eb4650c1c187857e1d91cda6;p=e-mobility-charging-stations-simulator.git Check for null or undefined in isEmptyObject() Signed-off-by: Jérôme Benoit --- diff --git a/src/utils/Utils.ts b/src/utils/Utils.ts index f6231998..8826f702 100644 --- a/src/utils/Utils.ts +++ b/src/utils/Utils.ts @@ -197,6 +197,9 @@ export default class Utils { } public static isEmptyObject(obj: object): boolean { + if (Utils.isNullOrUndefined(obj)) { + return false; + } // Iterates over the keys of an object, if // any exist, return false. for (const _ in obj) {