From 537d87a1d17cba302722eca225c600447ca8ebbd Mon Sep 17 00:00:00 2001 From: Joshua Larkin <70237359+j0shuams@users.noreply.github.com> Date: Tue, 16 Mar 2021 23:02:09 -0700 Subject: [PATCH] Update ComWrappersSupport (#771) * move IsTypeWindowsRuntimeType under null check, fixes build break --- src/WinRT.Runtime/ComWrappersSupport.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/WinRT.Runtime/ComWrappersSupport.cs b/src/WinRT.Runtime/ComWrappersSupport.cs index 2f481c93a..67c20c0bd 100644 --- a/src/WinRT.Runtime/ComWrappersSupport.cs +++ b/src/WinRT.Runtime/ComWrappersSupport.cs @@ -347,11 +347,15 @@ static bool IsWindowsRuntimeType(Type type) WinRT.Projections.IsTypeWindowsRuntimeType(type)) return true; type = type.GetAuthoringMetadataType(); - if (type is object && type.GetCustomAttribute() is object) - return true; - return WinRT.Projections.IsTypeWindowsRuntimeType(type); - } - + if (type is object) + { + if ((type.GetCustomAttribute() is object) || + WinRT.Projections.IsTypeWindowsRuntimeType(type)) + return true; + } + return false; + } + if (type == typeof(string) || type.IsTypeOfType()) return true; if (type.IsDelegate())