CP-36392: Add null check in EnableHostAction.cs

Signed-off-by: Danilo Del Busso <Danilo.Del.Busso@citrix.com>
This commit is contained in:
Danilo Del Busso 2021-11-15 09:21:25 +00:00
parent b6a70e2ffc
commit 5f117e90c5
No known key found for this signature in database
GPG Key ID: 0C48542619080FD4

View File

@ -42,10 +42,10 @@ namespace XenAdmin.Actions
private readonly bool _resumeVMs;
public EnableHostAction(Host host, bool resumeVMs,Func<Pool, Host, long, long, bool> acceptNTolChangesOnEnable)
: base(host.Connection, Messages.HOST_ENABLE, Messages.WAITING, null, acceptNTolChangesOnEnable)
: base(host?.Connection, Messages.HOST_ENABLE, Messages.WAITING, null, acceptNTolChangesOnEnable)
{
Host = host ?? throw new ArgumentNullException("host");
_resumeVMs = resumeVMs;
Host = host;
AddCommonAPIMethodsToRoleCheck();
ApiMethodsToRoleCheck.Add("pool.ha_compute_hypothetical_max_host_failures_to_tolerate");
ApiMethodsToRoleCheck.Add("pool.set_ha_host_failures_to_tolerate");