From b40b5cb39eb44088100f2ce5efc2a6fdf4b84f26 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 25 Jan 2023 23:05:13 +0100 Subject: [PATCH] Fix a null or undefined condition MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/performance/storage/JsonFileStorage.ts | 2 +- ui/web/src/composables/Utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.34.1