Skip to content
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

Merged
merged 11 commits into from
May 18, 2022

Conversation

mike-rowley
Copy link
Contributor

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.

mike-rowley and others added 11 commits March 25, 2022 11:44
…mage is in Shared project as EmbeddeResource)
…Color/IconTintColorEffectRouter.ios.cs

Co-authored-by: Pedro Jesus <pedrojesus.cefet@gmail.com>
…Color/IconTintColorEffectRouter.ios.cs

Co-authored-by: Pedro Jesus <pedrojesus.cefet@gmail.com>
I have added a null check on button.ImageView in ClearTintColor to prevent a crash when OnDetach is called.  This NullReferenceException occured when changing Application.MainPage.
Copy link
Contributor

@bijington bijington left a comment

Choose a reason for hiding this comment

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

@mike-rowley thanks for this submission

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants