mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-17 09:45:02 +01: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
@ -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 New Issue
Block a user