This repository was archived by the owner on May 1, 2024. It is now read-only.
Fix for ClearTintColor NullReferenceException on ImageButton related to PR #1836 #1857
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I originally sent over a PR for Issue #934 and have found a small issue not addressed in PR #1836 which I also have this PR to resolve.
This PR is to fix a NullReferenceException in ClearTintColor when setting Application.MainPage to a different page when the current page uses the Tint Effect. In ClearTintColor the button.ImageView is null and not checked. I have added the conditional access qualifier and it resolves this issue.
I have also moved the detach PropertyChanged outside of the Image Null Checks in ClearTintColor as I noticed that when the ImageButton is being detached the ImageView of the button is null (I am unsure why) however I believe the PropertyChanged Event added in SetUITintColor functions should be removed regardless of the null state of the Image.