From 945e643d5c6f6d256d202898881d2cc9645e77e4 Mon Sep 17 00:00:00 2001 From: Jose Phillips Date: Mon, 26 Sep 2016 17:16:39 -0500 Subject: [PATCH] Fix Null Reference exception in Windows agent PS scripts This patch will be going to solve if a output of the powershell script returns null. Also change the version of the agent. Change-Id: I1927deab198283dcbebe00a03db693c41893295d Closes-bug: #1627851 --- contrib/windows-agent/WindowsAgent/PlanExecutor.cs | 2 +- contrib/windows-agent/WindowsAgent/Program.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/windows-agent/WindowsAgent/PlanExecutor.cs b/contrib/windows-agent/WindowsAgent/PlanExecutor.cs index 628eeb4d..0ce7a349 100644 --- a/contrib/windows-agent/WindowsAgent/PlanExecutor.cs +++ b/contrib/windows-agent/WindowsAgent/PlanExecutor.cs @@ -97,7 +97,7 @@ namespace Mirantis.Murano.WindowsAgent { currentResults.Add(new ExecutionResult { IsException = false, - Result = result.Select(SerializePsObject).Where(obj => obj != null).ToList() + Result = result.Where(obj => obj != null).Select(SerializePsObject).ToList() }); } } diff --git a/contrib/windows-agent/WindowsAgent/Program.cs b/contrib/windows-agent/WindowsAgent/Program.cs index 5aeba8a8..582ceafd 100644 --- a/contrib/windows-agent/WindowsAgent/Program.cs +++ b/contrib/windows-agent/WindowsAgent/Program.cs @@ -30,7 +30,7 @@ namespace Mirantis.Murano.WindowsAgent { base.OnStart(args); - Log.Info("Version 0.5.3"); + Log.Info("Version 0.5.4"); this.rabbitMqClient = new RabbitMqClient();