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

Unified Diff: pkg/analysis_server/lib/src/status/memory_use.dart

Issue 2421473007: Guard against a hypothetical null pointer dereference (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
« 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/status/memory_use.dart
diff --git a/pkg/analysis_server/lib/src/status/memory_use.dart b/pkg/analysis_server/lib/src/status/memory_use.dart
index 92657bcdc0454cfa26f3bdda521d0e47d9632b0f..8f68b0f37bdee06d4b6ea4e8066a0fc3f521eff5 100644
--- a/pkg/analysis_server/lib/src/status/memory_use.dart
+++ b/pkg/analysis_server/lib/src/status/memory_use.dart
@@ -225,8 +225,10 @@ class MemoryUseData {
DartSdkManager manager = server.sdkManager;
List<SdkDescription> descriptors = manager.sdkDescriptors;
for (SdkDescription descriptor in descriptors) {
- _processAnalysisContext(
- manager.getSdk(descriptor, () => null).context, manager);
+ DartSdk sdk = manager.getSdk(descriptor, () => null);
+ if (sdk != null) {
+ _processAnalysisContext(sdk.context, manager);
+ }
}
}
« 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