diff --git a/app/src/main/java/com/nextcloud/talk/conversationinfo/viewmodel/ConversationInfoViewModel.kt b/app/src/main/java/com/nextcloud/talk/conversationinfo/viewmodel/ConversationInfoViewModel.kt index 1c2da4000..cb4bc7c3f 100644 --- a/app/src/main/java/com/nextcloud/talk/conversationinfo/viewmodel/ConversationInfoViewModel.kt +++ b/app/src/main/java/com/nextcloud/talk/conversationinfo/viewmodel/ConversationInfoViewModel.kt @@ -319,14 +319,19 @@ class ConversationInfoViewModel @Inject constructor( } } + @Suppress("Detekt.TooGenericExceptionCaught") fun getProfileData(user: User, userId: String) { val url = ApiUtils.getUrlForProfile(user.baseUrl!!, userId) viewModelScope.launch { - val profile = conversationsRepository.getProfile(user.getCredentials(), url) - if (profile != null) { - _getProfileViewState.value = GetProfileSuccessState(profile) - } else { - _getProfileViewState.value = GetProfileErrorState + try { + val profile = conversationsRepository.getProfile(user.getCredentials(), url) + if (profile != null) { + _getProfileViewState.value = GetProfileSuccessState(profile) + } else { + _getProfileViewState.value = GetProfileErrorState + } + } catch (e: Exception) { + Log.w(TAG, "Failed to get profile data (if not supported there wil be http405)", e) } } }