diff --git a/lib/core/engine.js b/lib/core/engine.js index a39ec5e50..bfdca869f 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'); }); });