diff options
Diffstat (limited to 'src/System.Private.Reflection.Core/src/System/Reflection/Runtime/General/NativeFormat/DefaultValueParser.cs')
-rw-r--r-- | src/System.Private.Reflection.Core/src/System/Reflection/Runtime/General/NativeFormat/DefaultValueParser.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/System.Private.Reflection.Core/src/System/Reflection/Runtime/General/NativeFormat/DefaultValueParser.cs b/src/System.Private.Reflection.Core/src/System/Reflection/Runtime/General/NativeFormat/DefaultValueParser.cs index e76be1914..244d351ad 100644 --- a/src/System.Private.Reflection.Core/src/System/Reflection/Runtime/General/NativeFormat/DefaultValueParser.cs +++ b/src/System.Private.Reflection.Core/src/System/Reflection/Runtime/General/NativeFormat/DefaultValueParser.cs @@ -14,7 +14,7 @@ namespace System.Reflection.Runtime.General.NativeFormat if (!(constantHandle.IsNull(reader))) { defaultValue = constantHandle.ParseConstantValue(reader); - if ((!raw) && declaredType.IsEnum) + if ((!raw) && declaredType.IsEnum && defaultValue != null) defaultValue = Enum.ToObject(declaredType, defaultValue); return true; } |