Skip to content

Commit 4db33ba

Browse files
author
Johannes J. Schmidt
committed
fix: include conflicts only if present
1 parent ac963da commit 4db33ba

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

memory-p.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const fromStore = (store, _id, { revs, conflicts }) => {
4848

4949
// if `options.conflicts` and there are conflicts, get conflicts from branches
5050
// lookup full revisions (including revision position)
51-
const _conflicts = conflicts && store.ids[_id].branches ? store.ids[_id].branches.map(rev => store.revs[rev].body._rev) : null
51+
const _conflicts = conflicts && store.ids[_id].branches && store.ids[_id].branches.length ? store.ids[_id].branches.map(rev => store.revs[rev].body._rev).reverse() : null
5252

5353
// if `options.revs`, return a revisions object including start and revision tree
5454
const _revisions = revs ? { start: parseInt(body._rev, 10), ids: getRevTree(store, rev) } : null

0 commit comments

Comments
 (0)