From 8f72796891838af34686a189cc26c3930a33fffc Mon Sep 17 00:00:00 2001 From: Ammar Githam Date: Thu, 25 Mar 2021 21:14:08 +0900 Subject: [PATCH] Null check. Fixes https://github.com/austinhuang0131/barinsta/issues/863 --- .../main/java/awais/instagrabber/managers/ThreadManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/awais/instagrabber/managers/ThreadManager.java b/app/src/main/java/awais/instagrabber/managers/ThreadManager.java index 90d67df3..6f1e98ba 100644 --- a/app/src/main/java/awais/instagrabber/managers/ThreadManager.java +++ b/app/src/main/java/awais/instagrabber/managers/ThreadManager.java @@ -264,7 +264,10 @@ public final class ThreadManager { } private List getUsersWithCurrentUser(final DirectThread t) { - final ImmutableList.Builder builder = ImmutableList.builder().add(currentUser); + final ImmutableList.Builder builder = ImmutableList.builder(); + if (currentUser != null) { + builder.add(currentUser); + } final List users = t.getUsers(); if (users != null) { builder.addAll(users);