diff options
author | Docile-Alligator <chineseperson5@gmail.com> | 2022-06-27 10:04:19 +0000 |
---|---|---|
committer | Docile-Alligator <chineseperson5@gmail.com> | 2022-06-27 10:04:19 +0000 |
commit | d27140adf7ce27618791633b92e5bbe4e4e3569a (patch) | |
tree | 8f7ce3fa381fc066d466cbee1d8fe14923a14dd5 /app/src/main/java/ml/docilealligator | |
parent | 974730db1a6769bb34db54789d7818acf85a3edc (diff) | |
download | infinity-for-reddit-d27140adf7ce27618791633b92e5bbe4e4e3569a.tar infinity-for-reddit-d27140adf7ce27618791633b92e5bbe4e4e3569a.tar.gz infinity-for-reddit-d27140adf7ce27618791633b92e5bbe4e4e3569a.tar.bz2 infinity-for-reddit-d27140adf7ce27618791633b92e5bbe4e4e3569a.tar.lz infinity-for-reddit-d27140adf7ce27618791633b92e5bbe4e4e3569a.tar.xz infinity-for-reddit-d27140adf7ce27618791633b92e5bbe4e4e3569a.tar.zst infinity-for-reddit-d27140adf7ce27618791633b92e5bbe4e4e3569a.zip |
Fix java.lang.StringIndexOutOfBoundsException in LinkResolverActivity.getRedditUriByPath.
Diffstat (limited to 'app/src/main/java/ml/docilealligator')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java index 79904bbc..ac305a11 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java @@ -92,6 +92,11 @@ public class LinkResolverActivity extends AppCompatActivity { } if (uri.getScheme() == null && uri.getHost() == null) { + if (uri.toString().isEmpty()) { + Toast.makeText(this, R.string.invalid_link, Toast.LENGTH_SHORT).show(); + finish(); + return; + } handleUri(getRedditUriByPath(uri.toString())); } else { handleUri(uri); |