mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-25 14:35:40 +03:00
Merge pull request #3803 from nextcloud/bugfix/noid/fixNpeForConversationCreation
avoid NPE when context is not known when creating conversation
This commit is contained in:
commit
e57f08f2d5
1 changed files with 9 additions and 7 deletions
|
@ -208,6 +208,7 @@ class CreateConversationDialogFragment : DialogFragment() {
|
|||
Log.e(TAG, "Failed to create conversation")
|
||||
showError()
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
@ -256,13 +257,14 @@ class CreateConversationDialogFragment : DialogFragment() {
|
|||
}
|
||||
|
||||
private fun initiateConversation(roomToken: String) {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomToken)
|
||||
|
||||
val chatIntent = Intent(context, ChatActivity::class.java)
|
||||
chatIntent.putExtras(bundle)
|
||||
chatIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
||||
startActivity(chatIntent)
|
||||
activity?.let {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomToken)
|
||||
val chatIntent = Intent(it, ChatActivity::class.java)
|
||||
chatIntent.putExtras(bundle)
|
||||
chatIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
||||
startActivity(chatIntent)
|
||||
}
|
||||
|
||||
dismiss()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue