CLOUDSTACK-6620: Fixed null pointer exception in hyperv agent in getting vmstats, when all vms are deleted from outside
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b82e2625 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b82e2625 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b82e2625 Branch: refs/heads/master Commit: b82e26253c9f13c215558f78d8f1eab7cf8f9eb9 Parents: 7916542 Author: Anshul Gangwar <[email protected]> Authored: Fri May 9 14:49:32 2014 +0530 Committer: Devdeep Singh <[email protected]> Committed: Fri May 9 16:31:25 2014 +0530 ---------------------------------------------------------------------- .../hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs | 4 ++++ 1 file changed, 4 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b82e2625/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs index 7dbb8c1..372f848 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<string, VmStatsEntry> vmProcessorInfo, List<System.Management.ManagementPath> 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?
