java/syncbase: Avoid NullPointerException (resume marker)
The null resume marker shouldn't trigger a null pointer exception
since the default case is that the resume marker is empty.
Change-Id: I58653080b5577864286a9dc854a39f46a940d509
diff --git a/syncbase/src/main/java/io/v/syncbase/Database.java b/syncbase/src/main/java/io/v/syncbase/Database.java
index 87d5263..3a97b4f 100644
--- a/syncbase/src/main/java/io/v/syncbase/Database.java
+++ b/syncbase/src/main/java/io/v/syncbase/Database.java
@@ -372,7 +372,7 @@
// constructed using some sort of query builder API.
// TODO(sadovsky): Support specifying resumeMarker. Note, watch-from-resumeMarker may be
// problematic in that we don't track the governing ACL for changes in the watch log.
- if (opts.resumeMarker.length != 0) {
+ if (opts.resumeMarker != null && opts.resumeMarker.length != 0) {
throw new RuntimeException("Specifying resumeMarker is not yet supported");
}
InputChannel<io.v.v23.syncbase.WatchChange> ic = mVDatabase.watch(Syncbase.getVContext(), ImmutableList.of(new CollectionRowPattern("%", "%", "%")));