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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/element/LocalVariableElementImpl.java

Issue 128443003: Analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes for review comments. Created 6 years, 11 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
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/element/LocalVariableElementImpl.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/element/LocalVariableElementImpl.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/element/LocalVariableElementImpl.java
index e522bdfbd9490df63a7c87387d4983baf1d5e826..91e51f2bfe1df4e3227001feac3d45b32c8c04b2 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/element/LocalVariableElementImpl.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/element/LocalVariableElementImpl.java
@@ -73,7 +73,11 @@ public class LocalVariableElementImpl extends VariableElementImpl implements Loc
@Override
public ToolkitObjectElement[] getToolkitObjects() {
- return getAncestor(CompilationUnitElementImpl.class).getToolkitObjects(this);
+ CompilationUnitElementImpl unit = getAncestor(CompilationUnitElementImpl.class);
+ if (unit == null) {
+ return ToolkitObjectElement.EMPTY_ARRAY;
+ }
+ return unit.getToolkitObjects(this);
}
@Override
@@ -114,7 +118,11 @@ public class LocalVariableElementImpl extends VariableElementImpl implements Loc
* @param toolkitObjects the toolkit objects attached to this variable
*/
public void setToolkitObjects(ToolkitObjectElement[] toolkitObjects) {
- getAncestor(CompilationUnitElementImpl.class).setToolkitObjects(this, toolkitObjects);
+ CompilationUnitElementImpl unit = getAncestor(CompilationUnitElementImpl.class);
+ if (unit == null) {
+ return;
+ }
+ unit.setToolkitObjects(this, toolkitObjects);
}
/**

Powered by Google App Engine
This is Rietveld 408576698