mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-02-03 02:43:25 +00:00
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
65b29d5db6
commit
4039bbac6b
@ -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…
x
Reference in New Issue
Block a user