diff --git a/lib/contracts/compiler.js b/lib/contracts/compiler.js index af2cc5eb..e6c4fc23 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); }); diff --git a/lib/modules/solidity/index.js b/lib/modules/solidity/index.js index 054a7287..46012b2b 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;