From 4942f5304a349af99a2512966c332d033a0beb4c Mon Sep 17 00:00:00 2001 From: Brian Wilkerson Date: Fri, 14 Oct 2016 12:31:11 -0700 Subject: [PATCH] Guard against a hypothetical null pointer dereference R=scheglov@google.com Review URL: https://codereview.chromium.org/2421473007 . --- pkg/analysis_server/lib/src/status/memory_use.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/analysis_server/lib/src/status/memory_use.dart b/pkg/analysis_server/lib/src/status/memory_use.dart index 92657bcdc04..8f68b0f37bd 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 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); + } } }