Guard against a hypothetical null pointer dereference

R=scheglov@google.com

Review URL: https://codereview.chromium.org/2421473007 .
This commit is contained in:
Brian Wilkerson 2016-10-14 12:31:11 -07:00
parent 852ef37f71
commit 4942f5304a

View file

@ -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);
}
}
}