From 8e323d687091229d87dc244f5b67f473c28461db Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Tue, 19 Dec 2017 11:35:21 -0500 Subject: [PATCH] don't attempt to link contract if it's not in the code --- lib/contracts/deploy.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/contracts/deploy.js b/lib/contracts/deploy.js index c9ea7ada..67dec724 100644 --- a/lib/contracts/deploy.js +++ b/lib/contracts/deploy.js @@ -109,6 +109,9 @@ class Deploy { deployedAddress = deployedAddress.substr(2); } let linkReference = '__' + filename + ":" + contractObj.className; + if (contractCode.indexOf(linkReference) < 0) { + continue; + } let toReplace = linkReference + "_".repeat(40 - linkReference.length); contractCode = contractCode.replace(new RegExp(toReplace, "g"), deployedAddress); }