Fix exit conditions at startup
[e-mobility-charging-stations-simulator.git] / src / charging-station / ocpp / OCPPResponseService.ts
index eb49b752def235ce4ddbd8a3be65f2c5fd6822aa..94a943d7c5439ed7f77936d3e464fa6b81443eab 100644 (file)
@@ -18,10 +18,12 @@ export default abstract class OCPPResponseService {
   protected constructor() {
     this.ajv = new Ajv();
     ajvFormats(this.ajv);
+    this.responseHandler.bind(this);
+    this.validateResponsePayload.bind(this);
   }
 
   public static getInstance<T extends OCPPResponseService>(this: new () => T): T {
-    if (!OCPPResponseService.instance) {
+    if (OCPPResponseService.instance === null) {
       OCPPResponseService.instance = new this();
     }
     return OCPPResponseService.instance as T;