diff --git a/utils/inspect-response.js b/utils/inspect-response.js index 6bdc8c5c..d6fb79bb 100644 --- a/utils/inspect-response.js +++ b/utils/inspect-response.js @@ -13,7 +13,12 @@ const checkForAccDoesNotExist = (error, options) => { // below is optional approach, but "alias" in command options is better // const accountId = (options.accountId)? options.accountId : options.contractName; const currentNetwork = config.helperAccount; - console.log(chalk`\n{bold.red Account {bold.white ${options.accountId}} is not found in {bold.white ${suffixesToNetworks[currentNetwork]}}\n}`); + if (currentNetwork in suffixesToNetworks) { + console.log(chalk`\n{bold.red Account {bold.white ${options.accountId}} is not found in {bold.white ${suffixesToNetworks[currentNetwork]}}\n}`); + } + else { + console.log(chalk`\n{bold.red Account {bold.white ${options.accountId}} is not found in an undefined network: {bold.white ${currentNetwork}}\n}`); + } const accSuffix = String(options.accountId).match('[^.]*$')[0]; const accNetwork = suffixesToNetworks[accSuffix];