don't crash and instead inform user if contract cannot be profiled
This commit is contained in:
parent
a601541bb0
commit
1dcd30b3a8
|
@ -53,10 +53,14 @@ class Profiler {
|
|||
let cmdName = cmd.split(' ')[0];
|
||||
let contractName = cmd.split(' ')[1];
|
||||
if (cmdName === 'profile') {
|
||||
self.events.request('contracts:contract', contractName, (contract) => {
|
||||
self.logger.info("-- profile for " + contractName);
|
||||
this.profile(contractName, contract);
|
||||
});
|
||||
self.events.request('contracts:contract', contractName, (contract) => {
|
||||
if (!contract.deployedAddress) {
|
||||
self.logger.info("-- couldn't profile " + contractName + " - it's not deployed or could be an interface");
|
||||
return "";
|
||||
}
|
||||
self.logger.info("-- profile for " + contractName);
|
||||
this.profile(contractName, contract);
|
||||
});
|
||||
return "";
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue