File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -411,6 +411,15 @@ public static Type GetAttributeType( this CustomAttributeData source )
411411
412412 public static string GetMemberName ( this CustomAttributeNamedArgument source )
413413 {
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+
414423 return source . MemberName ;
415424 }
416425#else
You can’t perform that action at this time.
0 commit comments