From e29f8d4e160c12f6a95d1e9b01ccb998607d526f Mon Sep 17 00:00:00 2001 From: pedrobsaila Date: Mon, 21 Mar 2022 20:38:00 +0100 Subject: [PATCH] prevent BaseType from returning default --- .../src/Internal/Reflection/RuntimeTypeInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/nativeaot/System.Private.DisabledReflection/src/Internal/Reflection/RuntimeTypeInfo.cs b/src/coreclr/nativeaot/System.Private.DisabledReflection/src/Internal/Reflection/RuntimeTypeInfo.cs index 6d1fd826f6518..7ff617784fc7e 100644 --- a/src/coreclr/nativeaot/System.Private.DisabledReflection/src/Internal/Reflection/RuntimeTypeInfo.cs +++ b/src/coreclr/nativeaot/System.Private.DisabledReflection/src/Internal/Reflection/RuntimeTypeInfo.cs @@ -53,7 +53,7 @@ public override Type BaseType { get { - if (RuntimeAugments.TryGetBaseType(_typeHandle, out RuntimeTypeHandle baseTypeHandle)) + if (RuntimeAugments.TryGetBaseType(_typeHandle, out RuntimeTypeHandle baseTypeHandle) && !baseTypeHandle.Equals(default)) { return GetRuntimeTypeInfo(baseTypeHandle); }