diff --git a/lib/core/engine.js b/lib/core/engine.js index 8139e2be9..e7aa45bad 100644 --- a/lib/core/engine.js +++ b/lib/core/engine.js @@ -146,7 +146,9 @@ class Engine { self.currentAbi = abi; self.contractsJSON = contractsJSON; pipeline.build(abi, contractsJSON, null, function() { - self.watch.restart(); // Necessary because changing a file while it is writing can stop it from being watched + if (self.watch) { + self.watch.restart(); // Necessary because changing a file while it is writing can stop it from being watched + } self.events.emit('outputDone'); }); });