Index: pkg/analyzer/lib/src/generated/resolver.dart |
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart |
index 1c3a644d230aa3c51518fe6a85c617a7e7cfd14f..ac5513cc217f76725aa36f76daa37d143f8b9a04 100644 |
--- a/pkg/analyzer/lib/src/generated/resolver.dart |
+++ b/pkg/analyzer/lib/src/generated/resolver.dart |
@@ -4073,7 +4073,9 @@ class GatherUsedLocalElementsVisitor extends RecursiveAstVisitor { |
visitSimpleIdentifier(SimpleIdentifier node) { |
Element element = node.staticElement; |
if (node.inDeclarationContext()) { |
- definedElements.add(element); |
+ if (element != null) { |
+ definedElements.add(element); |
+ } |
return; |
} |
bool isIdentifierRead = _isReadIdentifier(node); |