Browse Source
fix size comparison & handle empty paths list
renovate/org.robolectric-robolectric-4.x
tcely
4 years ago
No known key found for this signature in database
GPG Key ID: E361829E1B3040DB
1 changed files with
6 additions and
2 deletions
-
app/src/main/java/awais/instagrabber/utils/IntentUtils.java
|
@ -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)) { |
|
|