diff --git a/js/models/core/Wallet.js b/js/models/core/Wallet.js index c6a114c91..15e39040a 100644 --- a/js/models/core/Wallet.js +++ b/js/models/core/Wallet.js @@ -933,6 +933,9 @@ Wallet.prototype.receivePaymentRequest = function(options, pr, cb) { return this.getUnspent(function(err, unspent) { if (options.fetch) { + if (!unspent || !unspent.length) { + return cb(new Error('No unspent outputs.')); + } self.createPaymentTxSync(options, merchantData, unspent); return cb(null, merchantData, pr); }