Fix NPE when operating on multiple conversations in batch mode.

fork-5.53.8
Cody Henthorne 2021-08-06 11:14:33 -04:00
rodzic b9ffbb8e92
commit fc51c4940c
1 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -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() {