From cfd1d4a421685791ff8597343b5e33c7f279d9a2 Mon Sep 17 00:00:00 2001 From: Ammar Githam Date: Wed, 14 Apr 2021 21:17:24 +0900 Subject: [PATCH] Null check csrf token --- .../java/awais/instagrabber/managers/ThreadManager.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/managers/ThreadManager.java b/app/src/main/java/awais/instagrabber/managers/ThreadManager.java index 5b84c97c..6074363e 100644 --- a/app/src/main/java/awais/instagrabber/managers/ThreadManager.java +++ b/app/src/main/java/awais/instagrabber/managers/ThreadManager.java @@ -92,14 +92,14 @@ public final class ThreadManager { private final MutableLiveData pendingRequests = new MutableLiveData<>(null); private final String threadId; - private final DirectMessagesService service; private final long viewerId; private final ThreadIdOrUserIds threadIdOrUserIds; private final User currentUser; private final ContentResolver contentResolver; - private final MediaService mediaService; - private final FriendshipService friendshipService; + private DirectMessagesService service; + private MediaService mediaService; + private FriendshipService friendshipService; private InboxManager inboxManager; private LiveData thread; private LiveData inputMode; @@ -157,6 +157,7 @@ public final class ThreadManager { viewerId = CookieUtils.getUserIdFromCookie(cookie); final String deviceUuid = settingsHelper.getString(Constants.DEVICE_UUID); final String csrfToken = CookieUtils.getCsrfTokenFromCookie(cookie); + if (csrfToken == null) return; // if (TextUtils.isEmpty(csrfToken) || viewerId <= 0 || TextUtils.isEmpty(deviceUuid)) { // throw new IllegalArgumentException("User is not logged in!"); // }