mirror of
https://github.com/KokaKiwi/BarInsta
synced 2025-12-14 15:56:31 +00:00
Simplify null and empty check
This commit is contained in:
parent
87a7c400d7
commit
0a8b7020b5
1 changed files with 23 additions and 21 deletions
|
|
@ -121,10 +121,13 @@ public final class Utils {
|
||||||
|
|
||||||
public static void setupCookies(final String cookieRaw) {
|
public static void setupCookies(final String cookieRaw) {
|
||||||
final CookieStore cookieStore = NET_COOKIE_MANAGER.getCookieStore();
|
final CookieStore cookieStore = NET_COOKIE_MANAGER.getCookieStore();
|
||||||
if (cookieRaw == "LOGOUT") {
|
if (cookieStore == null || isEmpty(cookieRaw)) {
|
||||||
cookieStore.removeAll();
|
return;
|
||||||
|
}
|
||||||
|
if (cookieRaw.equals("LOGOUT")) {
|
||||||
|
cookieStore.removeAll();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if (cookieRaw != null && !isEmpty(cookieRaw)) {
|
|
||||||
try {
|
try {
|
||||||
final URI uri1 = new URI("https://instagram.com");
|
final URI uri1 = new URI("https://instagram.com");
|
||||||
final URI uri2 = new URI("https://instagram.com/");
|
final URI uri2 = new URI("https://instagram.com/");
|
||||||
|
|
@ -145,7 +148,6 @@ public final class Utils {
|
||||||
if (BuildConfig.DEBUG) Log.e("AWAISKING_APP", "", e);
|
if (BuildConfig.DEBUG) Log.e("AWAISKING_APP", "", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public static String getUserIdFromCookie(final String cookie) {
|
public static String getUserIdFromCookie(final String cookie) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue