| 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 a629ad52eb6f0fadb2971edef5a8e6a08d5a9f43..ae697914485764c60eb9dae7eb814f5a08625423 100644
|
| --- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
|
| +++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
|
| @@ -736,8 +736,13 @@ class FixProcessor {
|
| staticModifier = _inStaticContext();
|
| }
|
| utils.targetClassElement = targetClassElement;
|
| + // prepare target ClassDeclaration
|
| + AstNode targetTypeNode = targetClassElement.node;
|
| + if (targetTypeNode is! ClassDeclaration) {
|
| + return;
|
| + }
|
| + ClassDeclaration targetClassNode = targetTypeNode;
|
| // prepare location
|
| - ClassDeclaration targetClassNode = targetClassElement.node;
|
| _FieldLocation targetLocation = _prepareNewFieldLocation(targetClassNode);
|
| // build method source
|
| String targetFile = targetClassElement.source.fullName;
|
| @@ -861,8 +866,13 @@ class FixProcessor {
|
| staticModifier = _inStaticContext();
|
| }
|
| utils.targetClassElement = targetClassElement;
|
| + // prepare target ClassDeclaration
|
| + AstNode targetTypeNode = targetClassElement.node;
|
| + if (targetTypeNode is! ClassDeclaration) {
|
| + return;
|
| + }
|
| + ClassDeclaration targetClassNode = targetTypeNode;
|
| // prepare location
|
| - ClassDeclaration targetClassNode = targetClassElement.node;
|
| _FieldLocation targetLocation = _prepareNewGetterLocation(targetClassNode);
|
| // build method source
|
| String targetFile = targetClassElement.source.fullName;
|
|
|