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

Unified Diff: pkg/analysis_server/lib/src/search/search_domain.dart

Issue 2409403002: Issue 27542. Guard against CompilationUnitElement is null in SearchMatch.element getter. (Closed)
Patch Set: Created 4 years, 2 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
Index: pkg/analysis_server/lib/src/search/search_domain.dart
diff --git a/pkg/analysis_server/lib/src/search/search_domain.dart b/pkg/analysis_server/lib/src/search/search_domain.dart
index 37c58a69e5811e06cf039dafa67807aa5422178c..cdd39a3ca7ef3cee19364199198b93e2cae07941 100644
--- a/pkg/analysis_server/lib/src/search/search_domain.dart
+++ b/pkg/analysis_server/lib/src/search/search_domain.dart
@@ -98,6 +98,7 @@ class SearchDomainHandler implements protocol.RequestHandler {
// search
List<SearchMatch> matches =
await searchEngine.searchMemberDeclarations(params.name);
+ matches = SearchMatch.withNotNullElement(matches);
_sendSearchNotification(searchId, true, matches.map(toResult));
}
@@ -112,6 +113,7 @@ class SearchDomainHandler implements protocol.RequestHandler {
// search
List<SearchMatch> matches =
await searchEngine.searchMemberReferences(params.name);
+ matches = SearchMatch.withNotNullElement(matches);
_sendSearchNotification(searchId, true, matches.map(toResult));
}
@@ -135,6 +137,7 @@ class SearchDomainHandler implements protocol.RequestHandler {
// search
List<SearchMatch> matches =
await searchEngine.searchTopLevelDeclarations(params.pattern);
+ matches = SearchMatch.withNotNullElement(matches);
_sendSearchNotification(searchId, true, matches.map(toResult));
}

Powered by Google App Engine
This is Rietveld 408576698