Skip to content
This repository was archived by the owner on Mar 10, 2022. It is now read-only.

Commit 70e3795

Browse files
author
Hideki Itakura
authored
Fixed selectConflictRevision() (#1658)
1 parent d003f9b commit 70e3795

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

shared/src/main/java/com/couchbase/lite/AbstractDatabase.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,10 @@ void resolveConflictInDocument(String docID) throws CouchbaseLiteException {
738738
// Read the conflicting remote revision:
739739
Document remoteDoc = new Document((Database) this, docID, true);
740740
try {
741-
remoteDoc.selectConflictingRevision();
741+
if(!remoteDoc.selectConflictingRevision()){
742+
Log.w(TAG, "Unable to select conflicting revision for '%s', skipping...",docID);
743+
return;
744+
}
742745
} catch (LiteCoreException e) {
743746
throw CBLStatus.convertException(e);
744747
}

shared/src/main/java/com/couchbase/lite/Document.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ C4Document getC4doc() {
494494
}
495495
}
496496

497-
void selectConflictingRevision() throws LiteCoreException {
497+
boolean selectConflictingRevision() throws LiteCoreException {
498498
synchronized (lock) {
499499
boolean foundConflict = false;
500500
if (_c4doc != null) {
@@ -513,6 +513,7 @@ void selectConflictingRevision() throws LiteCoreException {
513513
}
514514
if (foundConflict)
515515
setC4Document(_c4doc);
516+
return foundConflict;
516517
}
517518
}
518519

0 commit comments

Comments
 (0)