X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fperformance%2Fstorage%2FJsonFileStorage.ts;h=f44d9f2b35adc56ca0d9d503e927ccfac6eae760;hb=41f18326bd0c915a2390208ab1c1973cc6c82a6e;hp=3fe5e58eed7aef75f35ae120e97033bd3cdb02d5;hpb=66a7748ddeda8c94d7562a1ce58d440319654a4c;p=e-mobility-charging-stations-simulator.git diff --git a/src/performance/storage/JsonFileStorage.ts b/src/performance/storage/JsonFileStorage.ts index 3fe5e58e..f44d9f2b 100644 --- a/src/performance/storage/JsonFileStorage.ts +++ b/src/performance/storage/JsonFileStorage.ts @@ -47,7 +47,7 @@ export class JsonFileStorage extends Storage { public open (): void { JsonFileStorage.performanceRecords = new Map() try { - if (this?.fd == null) { + if (this.fd == null) { if (!existsSync(dirname(this.dbName))) { mkdirSync(dirname(this.dbName), { recursive: true }) } @@ -66,9 +66,9 @@ export class JsonFileStorage extends Storage { public close (): void { JsonFileStorage.performanceRecords.clear() try { - if (this?.fd != null) { + if (this.fd != null) { closeSync(this.fd) - delete this?.fd + delete this.fd } } catch (error) { handleFileException( @@ -81,7 +81,7 @@ export class JsonFileStorage extends Storage { } private checkPerformanceRecordsFile (): void { - if (this?.fd == null) { + if (this.fd == null) { throw new BaseError( `${this.logPrefix} Performance records '${this.dbName}' file descriptor not found` )