Skip to content
Snippets Groups Projects
Commit ed6383fa authored by Amirhossein Naghshzan's avatar Amirhossein Naghshzan Committed by Adrien Béraud
Browse files

conversation: fix copy paste crash #1066

Change-Id: Ic512750e26c2ba2f9f0ebf99be171f3c5e2472b0
parent b4046980
No related branches found
No related tags found
No related merge requests found
...@@ -215,8 +215,12 @@ class ConversationFragment : BaseSupportFragment<ConversationPresenter, Conversa ...@@ -215,8 +215,12 @@ class ConversationFragment : BaseSupportFragment<ConversationPresenter, Conversa
ViewCompat.setOnReceiveContentListener(binding.msgInputTxt, SUPPORTED_MIME_TYPES) { _, contentInfo -> ViewCompat.setOnReceiveContentListener(binding.msgInputTxt, SUPPORTED_MIME_TYPES) { _, contentInfo ->
for (i in 0 until contentInfo.clip.itemCount) { for (i in 0 until contentInfo.clip.itemCount) {
val item: ClipData.Item = contentInfo.clip.getItemAt(i) val item: ClipData.Item = contentInfo.clip.getItemAt(i)
startFileSend(AndroidFileUtils.getCacheFile(requireContext(), item.uri) if (item.uri == null && item.text != null) {
.flatMapCompletable { sendFile(it) }) binding.msgInputTxt.setText(item.text)
} else {
startFileSend(AndroidFileUtils.getCacheFile(requireContext(), item.uri)
.flatMapCompletable { sendFile(it) })
}
} }
null null
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment