Logic fixlet to the control flow.
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 6 Feb 2021 13:18:57 +0000 (14:18 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 6 Feb 2021 13:18:57 +0000 (14:18 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/Bootstrap.ts

index bf776f9e7bbc19b382fd57b7067464abcc00f919..8c6d415a8198367639776712209b51e249720d4f 100644 (file)
@@ -64,8 +64,8 @@ export default class Bootstrap {
 
   public async stop(): Promise<void> {
     if (isMainThread && this.started) {
-      await this.getWorkerImplementationInstance().stop();
       if (this.getWorkerImplementationInstance()) {
+        await this.getWorkerImplementationInstance().stop();
         // Nullify to force worker implementation instance creation
         this.workerImplementationInstance = null;
       }