-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
5338 bug fix #5340
5338 bug fix #5340
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am able to reproduce the crash in main, and I confirm that this pull request fixes it.
Upload still works fine: https://commons.m.wikimedia.org/wiki/File%3AMarch_2007%2C_Old_house_in_Valleta.jpg
I just added two minor comments, would you mind editing?
Thanks a lot! :-)
* Represents the default index for the language list. By default, this index corresponds to the | ||
* English language. This serves as a fallback when the user's system language is not present in | ||
* the language_list.xml. Though this default can be changed by the user, it does not affect other | ||
* functionalities of the application. Fix bug issue 5338 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tiny change: Would you mind changing "Fix" to "Fixes" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I fix that, can you make approval for it? Thanks!
Thanks a lot @1162706031 for fixing the bug! |
Description (required)
Fixes #5338 (you should insert the actual issue number if one exists)
What changes did you make and why?
Fixed a potential ArrayIndexOutOfBoundsException in LanguagesAdapter. The bug was due to the method getIndexOfUserDefaultLocale possibly returning -1 when the user's default locale wasn't found in the language. codes list. The returned value is now properly checked and, if -1, defaults to DEFAULT_INDEX which is set to 0.
Tests performed (required)
Tested ProdDebug on Pixel 3 with API level 30. (replace with actual device and API details)
After multiple rounds of testing, in the case of Chinese and other languages, the program will not directly crash during the process of selecting and uploading images.
Before, the app would crash instantly before reaching this page.
Screenshots (for UI changes only)
N/A (since this is a bug fix and doesn't involve any UI changes)
Note: Please ensure that you have read CONTRIBUTING.md if this is your first pull request.
Remember, it's important to actually test the changes on a real device or emulator before submitting a pull request to ensure that the bug is genuinely fixed and no new issues are introduced.