fix(filtered-deck): preserve error message for InvalidSearchException…#21374
Merged
lukstbit merged 1 commit intoJul 17, 2026
Merged
Conversation
… in filtered deck the crash occurred when invalid search query was used and the search icon was tapped. here the InvalidSearchException was created without a message, causing the error dialog to crash. the fix ensures the localizedMessage is preserved
|
First PR! 🚀 We sincerely appreciate that you have taken the time to propose a change to AnkiDroid! Please have patience with us as we are all volunteers - we will get to this as soon as possible. |
lukstbit
approved these changes
Jul 16, 2026
lukstbit
left a comment
Member
There was a problem hiding this comment.
Looks good, thanks for contributing!
criticalAY
approved these changes
Jul 16, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jul 16, 2026
Contributor
Author
|
@lukstbit @criticalAY Thanks for reviewing and approving the PR. |
Member
You don't have to do anything, sometimes there are issues when merging PRs and we'll manually intervene. I added it again and it's merged now, thanks. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Purpose / Description
Crash when trying to preview an invalid search in the filtered deck options. when a user enters an invalid search query
(eg->"is:nee") and taps the search icon, the app crashes with "IllegalArgumentException either 'stringRes' or 'text' must be set".
Fixes
Approach
The root cause is that "FilteredDeckOptionsViewModel.onSearchBrowser()" creates and exception without preserving the message from the original "BackendSearchException". The message property was null, which caused the error dialog to crash when trying to display it.
How Has This Been Tested?
Tested the fixes on Pixel 8a(emulator android 17) and VivoV27(android 15), added regression test and also ran unit test FilteredDeckOptionsViewModelTest to ensure existing functionality is preserved.
Learning (optional, can help others)
NA
Checklist
Please, go through these checks before submitting the PR.