Skip to content

Commit 5867639

Browse files
bwilkersoncommit-bot@chromium.org
authored andcommitted
Fix an npe when Declaration._relevanceTags is null
There are several internal and external issues reported because of this bug. Change-Id: Ic166c0cf4ba15148e820878c0305249b4e26c2af Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154261 Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Brian Wilkerson <[email protected]>
1 parent b387ebc commit 5867639

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/analyzer/lib/src/services/available_declarations.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class Declaration {
5757
final String returnType;
5858
final String typeParameters;
5959

60-
final List<String> _relevanceTags;
60+
List<String> _relevanceTags;
6161
Uri _locationLibraryUri;
6262

6363
Declaration({
@@ -1687,6 +1687,7 @@ class _File {
16871687
for (var declaration in declarations) {
16881688
var tags = RelevanceTags._forDeclaration(uriStr, declaration);
16891689
if (tags != null) {
1690+
declaration._relevanceTags ??= [];
16901691
declaration._relevanceTags.addAll(tags);
16911692
}
16921693
_computeRelevanceTags(declaration.children);

0 commit comments

Comments
 (0)