aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorDocile-Alligator <chineseperson5@gmail.com>2022-06-27 10:04:19 +0000
committerDocile-Alligator <chineseperson5@gmail.com>2022-06-27 10:04:19 +0000
commitd27140adf7ce27618791633b92e5bbe4e4e3569a (patch)
tree8f7ce3fa381fc066d466cbee1d8fe14923a14dd5 /app/src
parent974730db1a6769bb34db54789d7818acf85a3edc (diff)
downloadinfinity-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')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java5
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);