[MacCatalyst] [iOS] Fix IconTintColorBehavior ImageButton Disappearing and Crash On Source Change#2317
Merged
Conversation
Fixes issues when the image is changed on MacCatalyst where IconTintBehavior would throw a null reference on button.currentimage due to a race condition. This best case would cause the image to not display and worse case cause a complete crash of the app. This checks if the currentimage is null before proceeding. With this check added there is no longer a crash and the image button updates with the new image with the correct tint applied
Contributor
Author
|
@dotnet-policy-service agree |
TheCodeTraveler
approved these changes
Nov 5, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description of Change
Fixes issues when the image source is changed on a ButtonImage in MacCatalyst where IconTintBehavior would throw a null reference on button.CurrentImage due to a race condition.
Linked Issues
#2313
PR Checklist
approved(bug) orChampioned(feature/proposal)mainat time of PRAdditional information
This checks if the CurrentImage is null before proceeding. MacCatalyst and iOS has been tested, both found to have the bug and are fixed with this patch.