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

ReflectionHelper fixes for invalid cache entries and unintended exceptions. #193

Conversation

tstaples
Copy link
Contributor

Added a struct to wrap cache entries for the sake of tracking invalid lookups. This fixes the issue where a null reference exception would be thrown when trying to lookup non-existent or non-private members.

Added a null check to GetPrivateValue and it's overloads to fix the issue where it would throw a null reference exception when required was false and the field was null.

Note: The IsValid flag of in the CacheEntry struct is technically redundant for now. I left it as it seems more correct than just checking if MemberInfo is null and it may be useful later. Feel free to remove it though if you see no purpose for it.

… lookups. This fixes the issue where a null reference exception would be thrown when trying to look up non-existant or non-private members.

Added a null check to GetPrivateValue and it's overloads to fix the issue where it would throw a null reference exception when required was false and the field was null.
@Pathoschild Pathoschild added the bug This is an unintended error or behavior that can be addressed with specific development changes. label Dec 13, 2016
@Pathoschild Pathoschild added this to the 1.5 milestone Dec 13, 2016
@Pathoschild Pathoschild merged commit a3b6816 into Pathoschild:develop Dec 18, 2016
Pathoschild added a commit that referenced this pull request Dec 18, 2016
@Pathoschild
Copy link
Owner

Merged into develop for the upcoming 1.5 release. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This is an unintended error or behavior that can be addressed with specific development changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants