mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-23 07:07:30 +00:00
fix size comparison & handle empty paths list
This commit is contained in:
parent
94ea635ca4
commit
9a889ef385
@ -21,8 +21,12 @@ public final class IntentUtils {
|
|||||||
// final boolean isHttpsUri = "https".equals(parsedUrl.getScheme());
|
// final boolean isHttpsUri = "https".equals(parsedUrl.getScheme());
|
||||||
|
|
||||||
final List<String> paths = parsedUrl.getPathSegments();
|
final List<String> paths = parsedUrl.getPathSegments();
|
||||||
String path = paths.get(0);
|
|
||||||
|
|
||||||
|
if (paths.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
String path = paths.get(0);
|
||||||
String text = null;
|
String text = null;
|
||||||
IntentModelType type = IntentModelType.UNKNOWN;
|
IntentModelType type = IntentModelType.UNKNOWN;
|
||||||
if (1 == paths.size()) {
|
if (1 == paths.size()) {
|
||||||
@ -34,7 +38,7 @@ public final class IntentUtils {
|
|||||||
} else if ("p".equals(path) || "reel".equals(path) || "tv".equals(path)) {
|
} else if ("p".equals(path) || "reel".equals(path) || "tv".equals(path)) {
|
||||||
text = paths.get(1);
|
text = paths.get(1);
|
||||||
type = IntentModelType.POST;
|
type = IntentModelType.POST;
|
||||||
} else if (2 >= paths.size() && "explore".equals(path)) {
|
} else if (2 < paths.size() && "explore".equals(path)) {
|
||||||
path = paths.get(1);
|
path = paths.get(1);
|
||||||
|
|
||||||
if ("locations".equals(path)) {
|
if ("locations".equals(path)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user