From bcb7c807584ff94fc561abc946ea7c0e8c8663b1 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Thu, 17 May 2018 09:48:01 -0400 Subject: [PATCH 1/2] Early return if no sol files --- lib/modules/solidity/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/modules/solidity/index.js b/lib/modules/solidity/index.js index 054a7287f..46012b2b4 100644 --- a/lib/modules/solidity/index.js +++ b/lib/modules/solidity/index.js @@ -12,6 +12,9 @@ class Solidity { } compile_solidity(contractFiles, cb) { + if (!contractFiles.length) { + return cb(); + } let self = this; let input = {}; let solcW; From 8e2af920b88de97341e0fb29a586f76f054e19d0 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Thu, 17 May 2018 10:02:53 -0400 Subject: [PATCH 2/2] early callback in compiler --- lib/contracts/compiler.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/contracts/compiler.js b/lib/contracts/compiler.js index af2cc5eb9..e6c4fc23e 100644 --- a/lib/contracts/compiler.js +++ b/lib/contracts/compiler.js @@ -32,7 +32,10 @@ class Compiler { return false; }); - compiler.call(compiler, matchingFiles || [], function (err, compileResult) { + if (!matchingFiles || !matchingFiles.length) { + return callback(); + } + compiler.call(compiler, matchingFiles, function (err, compileResult) { Object.assign(compiledObject, compileResult); callback(err, compileResult); });