diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/TypeInfos/NativeFormat/NativeFormatRuntimeNamedTypeInfo.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/TypeInfos/NativeFormat/NativeFormatRuntimeNamedTypeInfo.cs index 0551f69e04f85b..6bd208257dc319 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/TypeInfos/NativeFormat/NativeFormatRuntimeNamedTypeInfo.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/TypeInfos/NativeFormat/NativeFormatRuntimeNamedTypeInfo.cs @@ -77,12 +77,11 @@ public sealed override bool IsByRefLike Handle guidStringArgumentHandle = fahEnumerator.Current; if (fahEnumerator.MoveNext()) continue; - if (!(guidStringArgumentHandle.ParseConstantValue(_reader) is string guidString)) + if (guidStringArgumentHandle.HandleType != HandleType.ConstantStringValue) continue; - return new Guid(guidString); + return new Guid(guidStringArgumentHandle.ToConstantStringValueHandle(_reader).GetString(_reader)); } } - return null; }