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

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

Issue 1098493002: Issue 23184. Fix for exception when 'async' is used outside of a function body. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 | pkg/analysis_server/test/services/correction/fix_test.dart » ('j') | 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 eb9c8357dd6c02c054fcb77e710e99eff051a1e7..d370589aad437702f6ca312663ca5c7d267e33a8 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -330,7 +330,7 @@ class FixProcessor {
AstNode node = this.node;
if (_isAwaitNode()) {
FunctionBody body = node.getAncestor((n) => n is FunctionBody);
- if (body.keyword == null) {
+ if (body != null && body.keyword == null) {
_addReplaceEdit(rf.rangeStartLength(body, 0), 'async ');
_addFix(DartFixKind.ADD_ASYNC, []);
return true;
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/correction/fix_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698