Skip to content

Comments

[Android] Add defensive not null check to SearchHandlerAppearanceTracker.FocusChange#29939

Open
Transis-Felipe wants to merge 1 commit intodotnet:mainfrom
Transis-Felipe:patch-1
Open

[Android] Add defensive not null check to SearchHandlerAppearanceTracker.FocusChange#29939
Transis-Felipe wants to merge 1 commit intodotnet:mainfrom
Transis-Felipe:patch-1

Conversation

@Transis-Felipe
Copy link

@Transis-Felipe Transis-Felipe commented Jun 11, 2025

Check if _editText is null before detaching the event.

Check if _editText is null before detaching the event.
@Transis-Felipe Transis-Felipe requested a review from a team as a code owner June 11, 2025 17:41
@dotnet-policy-service
Copy link
Contributor

Hey there @@Transis-Felipe! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Jun 11, 2025
@jsuarezruiz jsuarezruiz added platform/android area-controls-shell Shell Navigation, Routes, Tabs, Flyout labels Jun 12, 2025
{
_searchHandler.PropertyChanged -= SearchHandlerPropertyChanged;
}
if (_editText != null)
Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM! Did you find a related issue? Can you describe the steps to reproduce it? I'd like to include a relevant test with the changes.

Copy link
Author

@Transis-Felipe Transis-Felipe Jun 12, 2025

Choose a reason for hiding this comment

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

@jsuarezruiz No, I don't find a direct issue related to this.

I was just investigating to see if I can find the reason of other leaks and found this.

It's just a defensive check to ensure that the _editText is not null before attempting to remove it from the FocusChange event.

@Transis-Felipe Transis-Felipe changed the title Update SearchHandlerAppearanceTracker.cs Add defensive not null check to Android SearchHandlerAppearanceTracker.FocusChange Jun 12, 2025
@Transis-Felipe Transis-Felipe changed the title Add defensive not null check to Android SearchHandlerAppearanceTracker.FocusChange [Android] Add defensive not null check to SearchHandlerAppearanceTracker.FocusChange Jun 16, 2025
This was referenced Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-shell Shell Navigation, Routes, Tabs, Flyout community ✨ Community Contribution platform/android

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants