From b82e26253c9f13c215558f78d8f1eab7cf8f9eb9 Mon Sep 17 00:00:00 2001 From: Anshul Gangwar Date: Fri, 9 May 2014 14:49:32 +0530 Subject: [PATCH] CLOUDSTACK-6620: Fixed null pointer exception in hyperv agent in getting vmstats, when all vms are deleted from outside --- .../hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs index 7dbb8c14fa1..372f848868c 100644 --- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs +++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs @@ -2685,6 +2685,10 @@ namespace HypervResource public void GetSummaryInfo(Dictionary vmProcessorInfo, List vmsToInspect) { + if (vmsToInspect == null || vmsToInspect.Count == 0) + { + return; + } // Process info available from WMI, // See http://msdn.microsoft.com/en-us/library/hh850062(v=vs.85).aspx uint[] requestedInfo = new uint[] { // TODO: correct?