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

Unified Diff: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java

Issue 9639002: Fix NPE in dartc (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
diff --git a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
index 8da6d96c04c29ba210be4828b4d478c051317405..a317c09bab65e8b2c7f66904583b4bb0eb795938 100644
--- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
+++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
@@ -1158,7 +1158,7 @@ public class TypeAnalyzer implements DartCompilationPhase {
if (returnType != null && returnType.getType() != voidType) {
typeError(returnType, TypeErrorCode.SETTER_RETURN_TYPE, methodElement.getName());
}
- if (methodElement.getParameters().size() > 0) {
+ if (currentClass != null && methodElement.getParameters().size() > 0) {
Element parameterElement = methodElement.getParameters().get(0);
Type setterType = parameterElement.getType();
MethodElement getterElement = Elements.lookupFieldElementGetter(currentClass.getElement(),
« 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