From 918e6f5b344ca81ed01310440b71ba04622fa6bc Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Thu, 26 Jul 2018 13:43:34 -0400 Subject: [PATCH] fix: Fixing enum casting exception in SimplSharp --- ICD.Common.Utils/EnumUtils.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ICD.Common.Utils/EnumUtils.cs b/ICD.Common.Utils/EnumUtils.cs index a681dc1..be5ff95 100644 --- a/ICD.Common.Utils/EnumUtils.cs +++ b/ICD.Common.Utils/EnumUtils.cs @@ -58,6 +58,7 @@ namespace ICD.Common.Utils /// public static bool IsEnum(T value) { +// ReSharper disable once CompareNonConstrainedGenericWithNull return value != null && IsEnumType(value.GetType()); } @@ -165,7 +166,7 @@ namespace ICD.Common.Utils private static IEnumerable GetValuesUncached() where T : struct, IConvertible { - return GetValuesUncached(typeof(T)).Cast(); + return GetValuesUncached(typeof(T)).Select(i => (T)(object)i); } ///