Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update source3.cs #4095

Merged
merged 1 commit into from
Jan 22, 2018
Merged

Update source3.cs #4095

merged 1 commit into from
Jan 22, 2018

Conversation

spence-m
Copy link

Title

Updated source3.cs to check the array length is zero, instead of checking for null

Summary

GetCustomAttributes never returns null, but instead returns an empty array when no attributes are found, as outlined here: https://msdn.microsoft.com/en-us/library/ms130871(v=vs.110).aspx. I have updated the docs to check that the array length is zero instead of checking for null.

GetCustomAttributes never returns null, but instead returns an empty array when no attributes are found.
@rpetrusha rpetrusha added the ✨ 1st-time docs contributor! Indicates PRs from new contributors to the docs repository label Jan 10, 2018
Copy link
Contributor

@rpetrusha rpetrusha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for correcting this programming error, @matthewspencerboxuk, and for contributing to the dotnet/docs repo. There are also Visual Basic and C++ versions of this example (at samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.attributes.usage/vb/source3.vb and samples/snippets/cpp/VS_Snippets_CLR/conceptual.attributes.usage\cpp/source3.cpp. Could you make this change there as well? We'd also be happy to make the change, If you'd prefer.

@spence-m
Copy link
Author

Hey @rpetrusha, happy to make the VB and C++ changes, will have a look into this later today.

@rpetrusha
Copy link
Contributor

Thanks for making this correction, @matthewspencerboxuk. We'll merge your PR now and open a separate PR to change the Visual Basic and C++ code.

@rpetrusha rpetrusha merged commit b29ed65 into dotnet:master Jan 22, 2018
@spence-m spence-m deleted the patch-2 branch April 17, 2018 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ 1st-time docs contributor! Indicates PRs from new contributors to the docs repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants