We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8f05de7 commit 584bd0cCopy full SHA for 584bd0c
1 file changed
src/MsgPack/ReflectionAbstractions.cs
@@ -411,6 +411,15 @@ public static Type GetAttributeType( this CustomAttributeData source )
411
412
public static string GetMemberName( this CustomAttributeNamedArgument source )
413
{
414
+ // This is hack to check null because .NET Standard 1.1 does not expose CustomAttributeNamedArgument.MemberInfo
415
+ // but it still throws NullReferenceException when its private MemberInfo type field is null.
416
+ // This is caused by default instance of CustomAttributeNamedArgument, so it also should have default CustomAttributeTypedArgument
417
+ // which has null ArgumentType.
418
+ if ( source.TypedValue.ArgumentType == null )
419
+ {
420
+ return null;
421
+ }
422
+
423
return source.MemberName;
424
}
425
#else
0 commit comments