mirror of https://github.com/embarklabs/embark.git
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
This commit is contained in:
parent
a04f26dc3d
commit
7a34b9d675
|
@ -55,7 +55,7 @@ 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) {
|
if (!contract || !contract.deployedAddress) {
|
||||||
self.logger.info("-- couldn't profile " + contractName + " - it's not deployed or could be an interface");
|
self.logger.info("-- couldn't profile " + contractName + " - it's not deployed or could be an interface");
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue