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(android/application): org.nativescript.widgets.Utils::getDrawable #9563
Conversation
packages/ui-mobile-base/android/widgets/src/main/java/org/nativescript/widgets/Utils.java
Outdated
Show resolved
Hide resolved
|
@sebj54 thanks for taking the time to do a PR - the change look good to me, I left a minor suggestion in the review. The way you can test this requires building the widgets, which can be done by running For this case specifically, I think a new test-case in the |
Co-authored-by: Igor Randjelovic <rigor789@gmail.com>
|
@rigor789 Thank you for your help! I added some views in the PS: The Android CI test has failed, is it expected? |
These make the app crash without the fix in place
|
@sebj54 yeah, the CI has been flaky for some time now, still not sure why - it works locally... I added a few more test-cases - the last few make the app crash without the fix, so they verify that this fixes the IndexOutOfBoundsException. Awesome job |
|
Thanks for the time you took to get me ready :) |
|
Thanks for taking the time @sebj54, hopefully sparked some interest in contributing again in the future |
|
I hope to be able to do it soon :) |
Avoid StringIndexOutOfBoundsException in org.nativescript.widgets.Utils
As it is my first PR to this repo, I am not experimented that much with native development. Feel free to guide me so I'll now next time :)
For example, I don't know how to test this file in a NativeScript project :/
PR Checklist
What is the current behavior?
Calling org.nativescript.widgets.Utils::getDrawable with a uri shorter than 6 characters throws a StringIndexOutOfBoundsException.
What is the new behavior?
An early check in this method ensures uri is longer than 6 characters so a warning is shown in the console.
Fixes #9562.
The text was updated successfully, but these errors were encountered: