From 4039bbac6b3d10f2c6ceb25342a33799200d3d73 Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Wed, 25 Jul 2018 09:51:10 +0100 Subject: [PATCH] Fix profile command In case the contract don't exist or the profile command don't have argument, embark don't crash and return an error --- lib/modules/profiler/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/modules/profiler/index.js b/lib/modules/profiler/index.js index 6bd51f2ac..4a4904000 100644 --- a/lib/modules/profiler/index.js +++ b/lib/modules/profiler/index.js @@ -55,7 +55,7 @@ class Profiler { let contractName = cmd.split(' ')[1]; if (cmdName === 'profile') { self.events.request('contracts:contract', contractName, (contract) => { - if (!contract.deployedAddress) { + if (!contract || !contract.deployedAddress) { self.logger.info("-- couldn't profile " + contractName + " - it's not deployed or could be an interface"); return ""; }