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

Unified Diff: pkg/analysis_server/lib/src/services/correction/fix_internal.dart

Issue 2664493004: Guard against FunctionExpression nodes with null parameters. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/services/correction/fix_internal.dart
diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
index dc59c71f0942701a26a4b8c2aa8a029b73cfb217..dc28bed7ba55bcb9917478de9e8180b5c8a83b3e 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -487,13 +487,13 @@ class FixProcessor {
AstNode targetNode = targetElement.computeNode();
if (targetNode is FunctionDeclaration) {
FunctionExpression function = targetNode.functionExpression;
- Token paren = function.parameters.leftParenthesis;
+ Token paren = function.parameters?.leftParenthesis;
if (paren == null) {
return;
}
targetOffset = paren.end;
} else if (targetNode is MethodDeclaration) {
- Token paren = targetNode.parameters.leftParenthesis;
+ Token paren = targetNode.parameters?.leftParenthesis;
if (paren == null) {
return;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698