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

Unified Diff: pkg/analysis_server/lib/src/services/index/indexable_element.dart

Issue 1162853004: Issue 23568. Fix for NPE in index when unresolved field formal parameter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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
Index: pkg/analysis_server/lib/src/services/index/indexable_element.dart
diff --git a/pkg/analysis_server/lib/src/services/index/indexable_element.dart b/pkg/analysis_server/lib/src/services/index/indexable_element.dart
index ce41dd9639dc9261b8a0b7013d97a53f27816907..c0a30e7bdb22990bfced242356be83e20b8d6cbc 100644
--- a/pkg/analysis_server/lib/src/services/index/indexable_element.dart
+++ b/pkg/analysis_server/lib/src/services/index/indexable_element.dart
@@ -23,7 +23,11 @@ class IndexableElement implements IndexableObject {
/**
* Initialize a newly created wrapper to wrap the given [element].
*/
- IndexableElement(this.element);
+ IndexableElement(this.element) {
+ if (element == null) {
+ throw new ArgumentError.notNull('element');
+ }
+ }
@override
int get hashCode => element.hashCode;
@@ -152,7 +156,7 @@ class IndexableElementKind implements IndexableObjectKind {
() => new IndexableElementKind._(ElementKind.CONSTRUCTOR));
}
ElementKind elementKind = element.kind;
- return _kindMap.putIfAbsent(elementKind, () =>
- new IndexableElementKind._(elementKind));
+ return _kindMap.putIfAbsent(
+ elementKind, () => new IndexableElementKind._(elementKind));
}
}

Powered by Google App Engine
This is Rietveld 408576698