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

Fix: DeckPicker-NullPointerException in onQueryTextChange #17403

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Giyutomioka-SS
Copy link
Contributor

@Giyutomioka-SS Giyutomioka-SS commented Nov 9, 2024

Purpose / Description

Fixes NullPointerException in onQueryTextChange by safely casting the adapter to Filterable before calling the filter method, preventing crashes when the adapter is null or not of the correct type.

Fixes

How Has This Been Tested?

Realme 6 and Emulator

Checklist

Please, go through these checks before submitting the PR.

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

@david-allison
Copy link
Member

Did you manage to reproduce the error?

This seems to convert the crash into a bug

@mikehardy mikehardy added the Needs Author Reply Waiting for a reply from the original author label Nov 9, 2024
@Giyutomioka-SS
Copy link
Contributor Author

I couldn’t reproduce the crash. Should I add a null check and logging to catch cases where the adapter or filter is unexpectedly null?

@david-allison
Copy link
Member

We shouldn't rush to a solution

The first step is to understand how the crash occurred, and ideally being able to reproduce it. Once we know this, we'll ideally be able to fix the cause rather than ignore user input

Did you check ACRA for a logcat?

@BrayanDSO BrayanDSO marked this pull request as draft November 19, 2024 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Author Reply Waiting for a reply from the original author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DeckPicker: onQueryTextChange - NullPointerException on filter
3 participants