From 5ad2aa302e4ef9aeb2998785f61cbbaaa71a829e Mon Sep 17 00:00:00 2001 From: Mihaela Stoica Date: Thu, 17 May 2018 11:25:07 +0100 Subject: [PATCH] CA-289959: Add null checks when resolving the updates which require reboot Signed-off-by: Mihaela Stoica --- XenAdmin/Diagnostics/Checks/RebootPendingOnMasterCheck.cs | 2 +- XenAdmin/TabPages/GeneralTabPage.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/XenAdmin/Diagnostics/Checks/RebootPendingOnMasterCheck.cs b/XenAdmin/Diagnostics/Checks/RebootPendingOnMasterCheck.cs index a0d2d689b..aa9028ddc 100644 --- a/XenAdmin/Diagnostics/Checks/RebootPendingOnMasterCheck.cs +++ b/XenAdmin/Diagnostics/Checks/RebootPendingOnMasterCheck.cs @@ -70,7 +70,7 @@ namespace XenAdmin.Diagnostics.Checks var update = Host.Connection.Resolve(updateRef); if (string.IsNullOrEmpty(UpdateUuid) || //automated mode, any update - string.Equals(update.uuid, UpdateUuid, System.StringComparison.InvariantCultureIgnoreCase)) //normal mode the given update + (update != null && string.Equals(update.uuid, UpdateUuid, System.StringComparison.InvariantCultureIgnoreCase))) //normal mode the given update { return new MasterIsPendingRestartHostProblem(this, pool); } diff --git a/XenAdmin/TabPages/GeneralTabPage.cs b/XenAdmin/TabPages/GeneralTabPage.cs index 101ed1072..56b359a16 100644 --- a/XenAdmin/TabPages/GeneralTabPage.cs +++ b/XenAdmin/TabPages/GeneralTabPage.cs @@ -1820,7 +1820,8 @@ namespace XenAdmin.TabPages foreach (var updateRef in updateRefs) { var update = host.Connection.Resolve(updateRef); - warnings.Add(CreateWarningRow(host, update)); + if (update != null) + warnings.Add(CreateWarningRow(host, update)); } // For Toolstack restart, legacy code has to be used to determine this - pool_patches are still populated for backward compatibility