Skip to content

Commit

Permalink
fix completion exception - fixes #24630
Browse files Browse the repository at this point in the history
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1418093003 .
  • Loading branch information
danrubel authored and whesse committed Oct 27, 2015
1 parent 4a97aa0 commit cb1abe9
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit cb1abe9

Please sign in to comment.