Skip to content

Commit

Permalink
Don't die on empty feed in partial replication
Browse files Browse the repository at this point in the history
  • Loading branch information
arj03 committed Oct 24, 2020
1 parent a6ea1f6 commit d51092d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ssb-partial-replication.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ exports.init = function (sbot, config) {
return pull(
pullCont(function(cb) {
SSB.db.getLatest(opts.id, (err, latest) => {
if (err) throw err
if (err) {
console.error("Got error on feed reverse", err)
return cb(null, pull.empty())
}

var seqStart = latest ? latest.sequence - (opts.limit - 1) : 0
if (seqStart < 0)
Expand Down

0 comments on commit d51092d

Please sign in to comment.