Avoid a useless branching.
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 1 Apr 2021 22:25:02 +0000 (00:25 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 1 Apr 2021 22:25:02 +0000 (00:25 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/charging-station/Bootstrap.ts

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