From 565a8d3dd63ba89e9e4a1547cc8fdb5bfee8843a Mon Sep 17 00:00:00 2001 From: Ammar Githam Date: Thu, 18 Mar 2021 21:50:39 +0900 Subject: [PATCH] Null check current user. Fixes 1 part of https://github.com/austinhuang0131/barinsta/issues/816 --- .../awais/instagrabber/viewmodels/DirectThreadViewModel.java | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/awais/instagrabber/viewmodels/DirectThreadViewModel.java b/app/src/main/java/awais/instagrabber/viewmodels/DirectThreadViewModel.java index 27cf10e4..4c01c658 100644 --- a/app/src/main/java/awais/instagrabber/viewmodels/DirectThreadViewModel.java +++ b/app/src/main/java/awais/instagrabber/viewmodels/DirectThreadViewModel.java @@ -279,6 +279,7 @@ public class DirectThreadViewModel extends AndroidViewModel { } public void markAsSeen() { + if (currentUser == null) return; final DirectThread thread = getThread().getValue(); if (thread == null) return; final List items = thread.getItems();