diff --git a/lib/bcoin/http/rpc.js b/lib/bcoin/http/rpc.js index 67a45ef5..0d097a9a 100644 --- a/lib/bcoin/http/rpc.js +++ b/lib/bcoin/http/rpc.js @@ -986,6 +986,12 @@ RPC.prototype.getchaintips = function getchaintips(args, callback) { RPC.prototype._findFork = function _findFork(entry, callback) { (function next(err, entry) { + if (err) + return callback(err); + + if (!entry) + return callback(new Error('Fork not found.')); + entry.isMainChain(function(err, main) { if (err) return callback(err);