diff --git a/src/main/java/com/couchbase/lite/BlobStore.java b/src/main/java/com/couchbase/lite/BlobStore.java index 0b914310..1e9bd439 100644 --- a/src/main/java/com/couchbase/lite/BlobStore.java +++ b/src/main/java/com/couchbase/lite/BlobStore.java @@ -185,6 +185,7 @@ public boolean getKeyForFilename(BlobKey outKey, String filename) { } public boolean hasBlobForKey(BlobKey key) { + if(key == null) return false; String path = getRawPathForKey(key); File file = new File(path); return file.isFile() && file.exists(); diff --git a/src/main/java/com/couchbase/lite/internal/AttachmentInternal.java b/src/main/java/com/couchbase/lite/internal/AttachmentInternal.java index 7a6b3f7e..76b19aa4 100644 --- a/src/main/java/com/couchbase/lite/internal/AttachmentInternal.java +++ b/src/main/java/com/couchbase/lite/internal/AttachmentInternal.java @@ -105,6 +105,7 @@ public AttachmentInternal(String name, Map attachInfo) if (revPos <= 0) { throw new CouchbaseLiteException(Status.BAD_ATTACHMENT); } + setRevpos(revPos); } // skip } else if (attachInfo.containsKey("follows") &&