From a710e4f052ac04de47cb32c52eefa57fce28391e Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Fri, 16 Feb 2018 13:36:22 -0500 Subject: [PATCH] Catching stupid Crestron exception --- ICD.Common.Utils/Extensions/ReflectionExtensions.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ICD.Common.Utils/Extensions/ReflectionExtensions.cs b/ICD.Common.Utils/Extensions/ReflectionExtensions.cs index 79f344b..7986791 100644 --- a/ICD.Common.Utils/Extensions/ReflectionExtensions.cs +++ b/ICD.Common.Utils/Extensions/ReflectionExtensions.cs @@ -42,7 +42,15 @@ namespace ICD.Common.Utils.Extensions if (extends == null) throw new ArgumentNullException("extends"); - return extends.GetCustomAttributes(typeof(T), inherits).Cast(); + try + { + return extends.GetCustomAttributes(typeof(T), inherits).Cast(); + } + // Crestron bug? + catch (ArgumentNullException) + { + return Enumerable.Empty(); + } } ///