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

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

Issue 10542146: Fix a couple of NPE's discovered while running Editor (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 | « compiler/java/com/google/dart/compiler/resolver/Resolver.java ('k') | 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
===================================================================
--- compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java (revision 8609)
+++ compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java (working copy)
@@ -601,6 +601,9 @@
private class VariableElementsRestorer {
private final Map<VariableElement, Type> typesMap = Maps.newHashMap();
void setType(VariableElement element, Type inferredType) {
+ if (element == null) {
+ return;
+ }
Type currentType = element.getType();
// remember original if not yet
if (!typesMap.containsKey(element)) {
« no previous file with comments | « compiler/java/com/google/dart/compiler/resolver/Resolver.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698