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:
authorMaxim Lipnin <v-maxlip@microsoft.com>2018-10-04 13:14:36 +0300
committerMarek Safar <marek.safar@gmail.com>2018-10-04 13:41:09 +0300
commitb6a822b7424dab39eee81f0c08160f996c9e9e27 (patch)
treed911e819628fcf86e1dba237e5aae1dc0f1d8d21
parent0fc965a5410ad2761d33eda4e81cebc4b4e08393 (diff)
Add null-check
-rw-r--r--src/System.Private.CoreLib/src/System/Reflection/CustomAttributeTypedArgument.cs2
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);