From 275fa8eb579cea538313ac4d66f10de51ddd42d1 Mon Sep 17 00:00:00 2001 From: Alessio Lombardi Date: Mon, 8 Aug 2022 16:50:44 +0100 Subject: [PATCH] Fixes #423 --- BHoM_UI/Components/Engine/Explode.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/BHoM_UI/Components/Engine/Explode.cs b/BHoM_UI/Components/Engine/Explode.cs index 4ca0638..1f131e1 100644 --- a/BHoM_UI/Components/Engine/Explode.cs +++ b/BHoM_UI/Components/Engine/Explode.cs @@ -86,7 +86,23 @@ public override object Run(List inputs) if (obj == null) return Enumerable.Repeat(null, m_CompiledSetters.Count).ToList(); - List result = OutputParams.Select(x => obj.PropertyValue(x.Name)).ToList(); + List result = new List(); + + foreach (var x in OutputParams) + { + object propValue = null; + try + { + propValue = obj.PropertyValue(x.Name); + } + catch + { + Engine.Base.Compute.RecordWarning($"Value of the property `{x.Name}` could not be retrieved."); + } + + result.Add(propValue); + } + return (result.Count == 1) ? result[0] : result; } }