Skip to content

Commit

Permalink
Update source3.cs (#4095)
Browse files Browse the repository at this point in the history
GetCustomAttributes never returns null, but instead returns an empty array when no attributes are found.
  • Loading branch information
spence-m authored and Ron Petrusha committed Jan 22, 2018
1 parent 1f26852 commit b29ed65
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static void GetAttribute(Type t)
DeveloperAttribute[] MyAttributes =
(DeveloperAttribute[]) Attribute.GetCustomAttributes(t, typeof (DeveloperAttribute));

if (MyAttributes == null)
if (MyAttributes.Length == 0)
{
Console.WriteLine("The attribute was not found.");
}
Expand Down Expand Up @@ -113,4 +113,4 @@ public static void GetAttribute(Type t)
}
}
//</snippet20>
}
}

0 comments on commit b29ed65

Please sign in to comment.