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

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

Issue 2609833002: Guard against missing enclosing class (issue 28163) (Closed)
Patch Set: Created 3 years, 12 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 52fe2130b214f9c8a3b17accfd5ff0301c77fd64..f0b353fa6ebe28abbfca0d4f79470f71a8927796 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -1659,6 +1659,9 @@ class FixProcessor {
void _addFix_makeEnclosingClassAbstract() {
ClassDeclaration enclosingClass =
node.getAncestor((node) => node is ClassDeclaration);
+ if (enclosingClass == null) {
+ return;
+ }
String className = enclosingClass.name.name;
_addInsertEdit(enclosingClass.classKeyword.offset, 'abstract ');
_addFix(DartFixKind.MAKE_CLASS_ABSTRACT, [className]);
« 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