Ensure performance statistics is started before connection to the OCPP
[e-mobility-charging-stations-simulator.git] / src / utils / PerformanceStatistics.ts
index e7cd58e8b9e17a39d1546c37c2a9d39d447d4c22..49f75adea6ef7fa12f43b82ad6b1aa967ea0e3ef 100644 (file)
@@ -75,7 +75,9 @@ export default class PerformanceStatistics {
   }
 
   public stop(): void {
-    clearInterval(this.displayInterval);
+    if (this.displayInterval) {
+      clearInterval(this.displayInterval);
+    }
     performance.clearMarks();
     this.performanceObserver.disconnect();
   }