Index: lib/src/rules/parameter_assignments.dart |
diff --git a/lib/src/rules/parameter_assignments.dart b/lib/src/rules/parameter_assignments.dart |
index a3760a241ce8744fb8945937b9914649bf113376..6188f4e4f44d62f6e7ed9178d02dfbcbd6889cbd 100644 |
--- a/lib/src/rules/parameter_assignments.dart |
+++ b/lib/src/rules/parameter_assignments.dart |
@@ -69,11 +69,16 @@ class _Visitor extends SimpleAstVisitor { |
@override |
void visitFunctionDeclaration(FunctionDeclaration node) { |
- node.functionExpression.parameters.parameters.forEach((e) { |
- if (node.functionExpression.body.isPotentiallyMutatedInScope(e.element)) { |
- rule.reportLint(e); |
- } |
- }); |
+ FormalParameterList parameters = node.functionExpression.parameters; |
+ if (parameters != null) { |
+ // Getter do not have formal parameters. |
+ parameters.parameters.forEach((e) { |
+ if (node.functionExpression.body |
+ .isPotentiallyMutatedInScope(e.element)) { |
+ rule.reportLint(e); |
+ } |
+ }); |
+ } |
} |
@override |