mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
use conversation-list-adapter more carefully
we're also checking for null at some other critical code positions, so this seems reasonable also here. this might fix a recently reported crash, maybe caused by a race condition.
This commit is contained in:
@@ -393,13 +393,16 @@ public class ConversationFragment extends MessageSelectorFragment
|
||||
}
|
||||
|
||||
void setLastSeen(long lastSeen) {
|
||||
getListAdapter().setLastSeen(lastSeen);
|
||||
if (lastSeenDecoration != null) {
|
||||
list.removeItemDecoration(lastSeenDecoration);
|
||||
}
|
||||
if (lastSeen > 0) {
|
||||
lastSeenDecoration = new ConversationAdapter.LastSeenHeader(getListAdapter());
|
||||
list.addItemDecoration(lastSeenDecoration);
|
||||
ConversationAdapter adapter = getListAdapter();
|
||||
if (adapter != null) {
|
||||
adapter.setLastSeen(lastSeen);
|
||||
if (lastSeenDecoration != null) {
|
||||
list.removeItemDecoration(lastSeenDecoration);
|
||||
}
|
||||
if (lastSeen > 0) {
|
||||
lastSeenDecoration = new ConversationAdapter.LastSeenHeader(adapter);
|
||||
list.addItemDecoration(lastSeenDecoration);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user