Skip to content

Commit 723baf7

Browse files
devoncarewcommit-bot@chromium.org
authored andcommitted
[analyzer] fix an npe in fix_internal.dart:2171
Bug: #39673 Change-Id: Iad903410ba5fecfa61992c2dfba9289c07234269 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127422 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Devon Carew <devoncarew@google.com>
1 parent 5adff87 commit 723baf7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/analysis_server/lib/src/services/correction/fix_internal.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2168,6 +2168,9 @@ class FixProcessor extends BaseProcessor {
21682168
// prepare target declaration
21692169
var targetDeclarationResult =
21702170
await sessionHelper.getElementDeclaration(targetElement);
2171+
if (targetDeclarationResult == null) {
2172+
return;
2173+
}
21712174
if (targetDeclarationResult.node is! ClassOrMixinDeclaration &&
21722175
targetDeclarationResult.node is! ExtensionDeclaration) {
21732176
return;

0 commit comments

Comments
 (0)