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

Unified Diff: pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart

Issue 1418093003: fix completion exception - fixes #24630 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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: pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart b/pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart
index 124fb32b859a6ed013b85ec53a70730c3d8d9d8e..4496adb9d702971a057e23b8d6520179f052cdbe 100644
--- a/pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart
+++ b/pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart
@@ -436,12 +436,16 @@ class InterfaceTypeSuggestionBuilder {
{bool isSuper: false, String containingMethodName: null}) {
CompilationUnit compilationUnit =
request.target.containingNode.getAncestor((n) => n is CompilationUnit);
- LibraryElement library = compilationUnit.element.library;
+ CompilationUnitElement unitElem = compilationUnit.element;
+ if (unitElem == null) {
+ return;
+ }
+ LibraryElement library = unitElem.library;
if (type is DynamicTypeImpl) {
type = request.cache.objectClassElement.type;
}
if (type is InterfaceType) {
- return new InterfaceTypeSuggestionBuilder(request)
+ new InterfaceTypeSuggestionBuilder(request)
._buildSuggestions(type, library, isSuper, containingMethodName);
}
}
« 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