Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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.cs2
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;
}