Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(602)

Unified Diff: lib/src/db/db.dart

Issue 943663002: Bugfix in sanity check: Prevent null-dereference (Closed) Base URL: git@github.com:dart-lang/gcloud.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.');
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698