diff options
-rw-r--r-- | src/System.Private.CoreLib/src/System/Reflection/CustomAttributeTypedArgument.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/System.Private.CoreLib/src/System/Reflection/CustomAttributeTypedArgument.cs b/src/System.Private.CoreLib/src/System/Reflection/CustomAttributeTypedArgument.cs index 8f09f8236..5af435962 100644 --- a/src/System.Private.CoreLib/src/System/Reflection/CustomAttributeTypedArgument.cs +++ b/src/System.Private.CoreLib/src/System/Reflection/CustomAttributeTypedArgument.cs @@ -33,7 +33,7 @@ namespace System.Reflection CustomAttributeTypedArgument[] new_value = new CustomAttributeTypedArgument[a.GetLength(0)]; for (int i = 0; i < new_value.Length; ++i) { var val = a.GetValue (i); - var elemType = etype == typeof (System.Object) ? val.GetType () : etype; + var elemType = etype == typeof (System.Object) && val != null ? val.GetType () : etype; new_value[i] = new CustomAttributeTypedArgument (elemType, val); } Value = new System.Collections.ObjectModel.ReadOnlyCollection <CustomAttributeTypedArgument>(new_value); |