CA-122423: Fixed XenCenter error at XenAPI.VGPU_type.get_Capacity()

# HG changeset patch
# User Mihaela Stoica <Mihaela.Stoica@citrix.com>
# Date 1385635158 0
#      Thu Nov 28 10:39:18 2013 +0000
# Node ID a760e46de0aad332bd24db705e329f8f718a6fef
# Parent  5a4abff0407e1d2265ab34163c4f4a68d521649d

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2013-12-11 10:29:10 +00:00
parent 0cd255132f
commit 2548edeecb

View File

@ -94,9 +94,11 @@ namespace XenAPI
if (supported_on_PGPUs != null && supported_on_PGPUs.Count > 0)
{
PGPU pgpu = Connection.Resolve(supported_on_PGPUs[0]);
if (pgpu.supported_VGPU_max_capacities != null && pgpu.supported_VGPU_max_capacities.Count > 0)
if (pgpu != null && pgpu.supported_VGPU_max_capacities != null && pgpu.supported_VGPU_max_capacities.Count > 0)
{
capacity = pgpu.supported_VGPU_max_capacities[new XenRef<VGPU_type>(this)];
var vgpuTypeRef = new XenRef<VGPU_type>(this);
if (pgpu.supported_VGPU_max_capacities.ContainsKey(vgpuTypeRef))
capacity = pgpu.supported_VGPU_max_capacities[vgpuTypeRef];
}
}
return capacity;