Unverified Commit 432bef6b authored by Rafael Kellermann Streit's avatar Rafael Kellermann Streit Committed by GitHub

Merge pull request #1752 from RocketChat/fix/admin-panel-crash

[FIX] admin panel crash
parents 5cd165f0 636003de
...@@ -719,9 +719,9 @@ class ChatRoomPresenter @Inject constructor( ...@@ -719,9 +719,9 @@ class ChatRoomPresenter @Inject constructor(
.filterNot { filterSelfOut && it.sender?.username == self } .filterNot { filterSelfOut && it.sender?.username == self }
val activeUsers = mutableListOf<PeopleSuggestionUiModel>() val activeUsers = mutableListOf<PeopleSuggestionUiModel>()
recentMessages.forEach { recentMessages.forEach {
val sender = it.sender!! val sender = it.sender
val username = sender.username ?: "" val username = sender?.username ?: ""
val name = sender.name ?: "" val name = sender?.name ?: ""
val avatarUrl = currentServer.avatarUrl(username) val avatarUrl = currentServer.avatarUrl(username)
val found = members.firstOrNull { member -> member.username == username } val found = members.firstOrNull { member -> member.username == username }
val status = if (found != null) found.status else UserStatus.Offline() val status = if (found != null) found.status else UserStatus.Offline()
......
...@@ -35,6 +35,7 @@ import chat.rocket.android.server.ui.ChangeServerActivity ...@@ -35,6 +35,7 @@ import chat.rocket.android.server.ui.ChangeServerActivity
import chat.rocket.android.settings.di.SettingsFragmentProvider import chat.rocket.android.settings.di.SettingsFragmentProvider
import chat.rocket.android.settings.password.di.PasswordFragmentProvider import chat.rocket.android.settings.password.di.PasswordFragmentProvider
import chat.rocket.android.settings.password.ui.PasswordActivity import chat.rocket.android.settings.password.ui.PasswordActivity
import chat.rocket.android.webview.adminpanel.di.AdminPanelWebViewFragmentProvider
import dagger.Module import dagger.Module
import dagger.android.ContributesAndroidInjector import dagger.android.ContributesAndroidInjector
...@@ -64,7 +65,8 @@ abstract class ActivityBuilder { ...@@ -64,7 +65,8 @@ abstract class ActivityBuilder {
ProfileFragmentProvider::class, ProfileFragmentProvider::class,
SettingsFragmentProvider::class, SettingsFragmentProvider::class,
AboutFragmentProvider::class, AboutFragmentProvider::class,
PreferencesFragmentProvider::class PreferencesFragmentProvider::class,
AdminPanelWebViewFragmentProvider::class
] ]
) )
abstract fun bindMainActivity(): MainActivity abstract fun bindMainActivity(): MainActivity
......
package chat.rocket.android.webview.adminpanel.di
import chat.rocket.android.webview.adminpanel.ui.AdminPanelWebViewFragment
import dagger.Module
import dagger.android.ContributesAndroidInjector
@Module
abstract class AdminPanelWebViewFragmentProvider {
@ContributesAndroidInjector
abstract fun provideAdminPanelWebViewFragment(): AdminPanelWebViewFragment
}
\ No newline at end of file
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