Strict null check fixes
[e-mobility-charging-stations-simulator.git] / src / performance / storage / MongoDBStorage.ts
index 54fc43349b2f3cbe8dbabc36ec3cd53dbc692936..9e5c06623830e3328979f88637ecc55571a012c7 100644 (file)
@@ -24,7 +24,7 @@ export class MongoDBStorage extends Storage {
     try {
       this.checkDBConnection();
       await this.client
-        .db(this.dbName)
+        ?.db(this.dbName)
         .collection<Statistics>(Constants.PERFORMANCE_RECORDS_TABLE)
         .insertOne(performanceStatistics);
     } catch (error) {