From d27140adf7ce27618791633b92e5bbe4e4e3569a Mon Sep 17 00:00:00 2001 From: Docile-Alligator Date: Mon, 27 Jun 2022 18:04:19 +0800 Subject: [PATCH] Fix java.lang.StringIndexOutOfBoundsException in LinkResolverActivity.getRedditUriByPath. --- .../infinityforreddit/activities/LinkResolverActivity.java | 5 +++++ 1 file changed, 5 insertions(+) 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);