CA-226112: Disable PVS read caching causes System.NullReferenceException

Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
This commit is contained in:
Mihaela Stoica 2016-10-20 14:52:51 +01:00
parent 1040027a6d
commit 994ced8388
2 changed files with 2 additions and 5 deletions

View File

@ -97,8 +97,7 @@ namespace XenAdmin.Commands
/// <returns></returns>
private AsyncAction GetAsyncActionForVm(VM vm)
{
var pvsProxy = vm.Connection.Cache.PVS_proxies.FirstOrDefault(p => p.VM.Equals(vm)); // null if no proxy
var pvsProxy = vm.PvsProxy;
if (pvsProxy == null) return null; // No proxy to disable
return new PvsProxyDestroyAction(pvsProxy);

View File

@ -139,9 +139,7 @@ namespace XenAdmin.Dialogs
/// <returns></returns>
private bool PvsProxyAlreadyEnabled(VM vm)
{
var pvsProxies = vm.Connection.Cache.PVS_proxies;
return pvsProxies.Any(pvsProxy => pvsProxy.VM.Equals(vm));
return vm.PvsProxy != null;
}
/// <summary>