Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

incorporated fix for issues noted by Jens here:

  • Loading branch information...
commit 42b5ee68c69806f5dc4540ff1a4e7b5586977788 1 parent 1b6a963
@mschoch mschoch authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 TouchDB-Android/src/com/couchbase/touchdb/TDDatabase.java
View
10 TouchDB-Android/src/com/couchbase/touchdb/TDDatabase.java
@@ -672,8 +672,11 @@ public TDRevision getDocumentWithIDAndRev(String id, String rev, EnumSet<TDConte
boolean deleted = (cursor.getInt(1) > 0);
result = new TDRevision(id, rev, deleted);
result.setSequence(cursor.getLong(2));
- if(!contentOptions.contains(TDContentOptions.TDNoBody)) {
- byte[] json = cursor.getBlob(3);
+ if(!contentOptions.equals(EnumSet.of(TDContentOptions.TDNoBody))) {
+ byte[] json = null;
+ if(!contentOptions.contains(TDContentOptions.TDNoBody)) {
+ json = cursor.getBlob(3);
+ }
expandStoredJSONIntoRevisionWithAttachments(json, result, contentOptions);
}
}
@@ -688,8 +691,7 @@ public TDRevision getDocumentWithIDAndRev(String id, String rev, EnumSet<TDConte
}
public boolean existsDocumentWithIDAndRev(String docId, String revId) {
- //OPT: Do this without loading the data
- return getDocumentWithIDAndRev(docId, revId, EnumSet.noneOf(TDContentOptions.class)) != null;
+ return getDocumentWithIDAndRev(docId, revId, EnumSet.of(TDContentOptions.TDNoBody)) != null;
}
public TDStatus loadRevisionBody(TDRevision rev, EnumSet<TDContentOptions> contentOptions) {
Please sign in to comment.
Something went wrong with that request. Please try again.