Commit 636003de authored by Lucio Maciel's avatar Lucio Maciel

Fix crash when missing sender

parent a1bf864b
......@@ -719,9 +719,9 @@ class ChatRoomPresenter @Inject constructor(
.filterNot { filterSelfOut && it.sender?.username == self }
val activeUsers = mutableListOf<PeopleSuggestionUiModel>()
recentMessages.forEach {
val sender = it.sender!!
val username = sender.username ?: ""
val name = sender.name ?: ""
val sender = it.sender
val username = sender?.username ?: ""
val name = sender?.name ?: ""
val avatarUrl = currentServer.avatarUrl(username)
val found = members.firstOrNull { member -> member.username == username }
val status = if (found != null) found.status else UserStatus.Offline()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment