diff --git a/lib/storage.js b/lib/storage.js index 45b3f2f..2f7cc06 100644 --- a/lib/storage.js +++ b/lib/storage.js @@ -650,7 +650,7 @@ Storage.prototype.getTxHistoryCache = function(walletId, from, to, cb) { }, function(err, result) { if (err) return cb(err); - if (result.history.length < end) + if (!result || result.history.length < end) return cb(); var ret = result.history.slice(fwdIndex, end);