Index: lib/src/db/db.dart |
diff --git a/lib/src/db/db.dart b/lib/src/db/db.dart |
index bf1c3f157f74c848e4777161418c79bc88915437..c417d1c288dede83eff8a4bfedd3fcedeff93dd8 100644 |
--- a/lib/src/db/db.dart |
+++ b/lib/src/db/db.dart |
@@ -315,7 +315,7 @@ class DatastoreDB { |
} else { |
partition = defaultPartition; |
} |
- } else if (partition != ancestorKey.partition) { |
+ } else if (ancestorKey != null && partition != ancestorKey.partition) { |
throw new ArgumentError( |
'Ancestor queries must have the same partition in the ancestor key ' |
'as the partition where the query executes in.'); |