don't crash and instead inform user if contract cannot be profiled
This commit is contained in:
parent
a601541bb0
commit
1dcd30b3a8
|
@ -54,6 +54,10 @@ class Profiler {
|
||||||
let contractName = cmd.split(' ')[1];
|
let contractName = cmd.split(' ')[1];
|
||||||
if (cmdName === 'profile') {
|
if (cmdName === 'profile') {
|
||||||
self.events.request('contracts:contract', 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);
|
self.logger.info("-- profile for " + contractName);
|
||||||
this.profile(contractName, contract);
|
this.profile(contractName, contract);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue