1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-11-22 14:47:29 +00:00

fix size comparison & handle empty paths list

This commit is contained in:
tcely 2021-05-19 15:19:44 -04:00
parent 94ea635ca4
commit 9a889ef385
No known key found for this signature in database
GPG Key ID: E361829E1B3040DB

View File

@ -21,8 +21,12 @@ public final class IntentUtils {
// final boolean isHttpsUri = "https".equals(parsedUrl.getScheme());
final List<String> paths = parsedUrl.getPathSegments();
String path = paths.get(0);
if (paths.isEmpty()) {
return null;
}
String path = paths.get(0);
String text = null;
IntentModelType type = IntentModelType.UNKNOWN;
if (1 == paths.size()) {
@ -34,7 +38,7 @@ public final class IntentUtils {
} else if ("p".equals(path) || "reel".equals(path) || "tv".equals(path)) {
text = paths.get(1);
type = IntentModelType.POST;
} else if (2 >= paths.size() && "explore".equals(path)) {
} else if (2 < paths.size() && "explore".equals(path)) {
path = paths.get(1);
if ("locations".equals(path)) {