Skip to content

Commit 8ddd666

Browse files
authored
Merge pull request #1331 from couchbase/feature/issue_and_933
Fixed https://github.com/couchbase/couchbase-lite-android/issues/933
2 parents a04cad3 + 60562e9 commit 8ddd666

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

src/main/java/com/couchbase/lite/Database.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,9 +1474,8 @@ public Map<String, Object> getRevisionHistoryDictStartingFromAnyAncestor(Revisio
14741474
List<String> ancestorRevIDs) {
14751475
List<RevisionInternal> history = getRevisionHistory(rev);
14761476
// (this is in reverse order, newest..oldest
1477-
if (ancestorRevIDs != null && ancestorRevIDs.size() > 0) {
1478-
int n = history.size();
1479-
for (int i = 0; i < n; ++i) {
1477+
if (ancestorRevIDs != null && ancestorRevIDs.size() > 0 && history != null) {
1478+
for (int i = 0; i < history.size(); ++i) {
14801479
if (ancestorRevIDs.contains(history.get(i).getRevID())) {
14811480
history = history.subList(0, i + 1);
14821481
break;

src/main/java/com/couchbase/lite/store/SQLiteStore.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,6 @@ public List<RevisionInternal> getRevisionHistory(RevisionInternal rev) {
896896
List<RevisionInternal> result;
897897
try {
898898
cursor = storageEngine.rawQuery(sql, args);
899-
900899
cursor.moveToNext();
901900
long lastSequence = 0;
902901
result = new ArrayList<RevisionInternal>();

0 commit comments

Comments
 (0)