Fix NPE when operating on multiple conversations in batch mode.

This commit is contained in:
Cody Henthorne
2021-08-06 11:14:33 -04:00
parent b9ffbb8e92
commit fc51c4940c

View File

@@ -20,6 +20,7 @@ import org.thoughtcrime.securesms.mms.GlideRequests;
import org.thoughtcrime.securesms.util.CachedInflater;
import org.thoughtcrime.securesms.util.ViewUtil;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
@@ -210,7 +211,7 @@ class ConversationListAdapter extends ListAdapter<Conversation, RecyclerView.Vie
}
Collection<Conversation> getBatchSelection() {
return batchSet.values();
return new ArrayList<>(batchSet.values());
}
@Override
@@ -233,7 +234,7 @@ class ConversationListAdapter extends ListAdapter<Conversation, RecyclerView.Vie
}
@NonNull Set<Long> getBatchSelectionIds() {
return batchSet.keySet();
return new HashSet<>(batchSet.keySet());
}
void selectAllThreads() {