Fix java.lang.StringIndexOutOfBoundsException in LinkResolverActivity.getRedditUriByPath.

This commit is contained in:
Docile-Alligator 2022-06-27 18:04:19 +08:00
parent 974730db1a
commit d27140adf7

View File

@ -92,6 +92,11 @@ public class LinkResolverActivity extends AppCompatActivity {
} }
if (uri.getScheme() == null && uri.getHost() == null) { 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())); handleUri(getRedditUriByPath(uri.toString()));
} else { } else {
handleUri(uri); handleUri(uri);