diff --git a/lib/cmds/blockchain/blockchain.js b/lib/cmds/blockchain/blockchain.js index ae83d0f80..b0b1ab6c6 100644 --- a/lib/cmds/blockchain/blockchain.js +++ b/lib/cmds/blockchain/blockchain.js @@ -56,15 +56,15 @@ var Blockchain = function(options) { } const spaceMessage = 'The path for %s in blockchain config contains spaces, please remove them'; - if (this.config.datadir.indexOf(' ') > 0) { + if (this.config.datadir && this.config.datadir.indexOf(' ') > 0) { console.error(__(spaceMessage, 'datadir')); process.exit(); } - if (this.config.account.password.indexOf(' ') > 0) { + if (this.config.account.password && this.config.account.password.indexOf(' ') > 0) { console.error(__(spaceMessage, 'account.password')); process.exit(); } - if (this.config.genesisBlock.indexOf(' ') > 0) { + if (this.config.genesisBlock && this.config.genesisBlock.indexOf(' ') > 0) { console.error(__(spaceMessage, 'genesisBlock')); process.exit(); }