Index: compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java |
diff --git a/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java b/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java |
index 14faa444ef5c32a61fd18ff7ceed3892e8fba14c..251d3962186a0347533b8d678fe82f715476f1fb 100644 |
--- a/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java |
+++ b/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java |
@@ -278,17 +278,16 @@ public class ResolutionContext implements ResolutionErrorListener { |
@Override |
public Element visitPropertyAccess(DartPropertyAccess node) { |
Element element = node.getQualifier().accept(this); |
- switch (element.getKind()) { |
- case LIBRARY: |
- Scope elementScope = ((LibraryElement) element).getScope(); |
- return elementScope.findElement(scope.getLibrary(), node.getPropertyName()); |
- |
- case CLASS: |
- return Elements.findElement((ClassElement) element, node.getPropertyName()); |
- |
- default: |
- return null; |
+ if (element != null) { |
+ switch (element.getKind()) { |
+ case LIBRARY : |
+ Scope elementScope = ((LibraryElement) element).getScope(); |
+ return elementScope.findElement(scope.getLibrary(), node.getPropertyName()); |
+ case CLASS : |
+ return Elements.findElement((ClassElement) element, node.getPropertyName()); |
+ } |
} |
+ return null; |
} |
@Override |