| 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);
|
| }
|
|
|
| /**
|
|
|