add some check when resolving a reference

This commit is contained in:
Jisheng Xing 2018-02-22 18:21:12 +08:00 committed by Cheng Zhang
parent 530462ad41
commit 3ec5805464

View File

@ -57,8 +57,14 @@ namespace XenAPI
}
else if(sriov_logical_PIF_of.Count != 0)
{
if (Connection == null)
return "";
Network_sriov network_s = Connection.Resolve(sriov_logical_PIF_of[0]);
if (network_s == null)
return "";
PIF pif = Connection.Resolve(network_s.physical_PIF);
if (pif == null)
return "";
return pif.Name();
}
else