From: Jérôme Benoit Date: Wed, 25 Jan 2023 22:05:13 +0000 (+0100) Subject: Fix a null or undefined condition X-Git-Tag: v1.1.92~11 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=b40b5cb39eb44088100f2ce5efc2a6fdf4b84f26;p=e-mobility-charging-stations-simulator.git Fix a null or undefined condition Signed-off-by: Jérôme Benoit --- diff --git a/src/performance/storage/JsonFileStorage.ts b/src/performance/storage/JsonFileStorage.ts index 48058340..d5eb848c 100644 --- a/src/performance/storage/JsonFileStorage.ts +++ b/src/performance/storage/JsonFileStorage.ts @@ -51,7 +51,7 @@ export class JsonFileStorage extends Storage { public open(): void { try { - if (this?.fd === undefined && this?.fd === null) { + if (this?.fd === undefined || this?.fd === null) { this.fd = fs.openSync(this.dbName, 'a+'); } } catch (error) { diff --git a/ui/web/src/composables/Utils.ts b/ui/web/src/composables/Utils.ts index 36ecd4b7..92f687d8 100644 --- a/ui/web/src/composables/Utils.ts +++ b/ui/web/src/composables/Utils.ts @@ -9,7 +9,7 @@ export default class Utils { return value as T; } - public static isIterable(obj: any): boolean { + public static isIterable>(obj: T): boolean { if (obj === null || obj === undefined) { return false; }