diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index 3234cb0a..a93a1215 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -1689,9 +1689,12 @@ public class ConversationActivity extends XmppActivity public void success(Message message) { message.setEncryption(Message.ENCRYPTION_DECRYPTED); xmppConnectionService.sendMessage(message); - if (mConversationFragment != null) { - mConversationFragment.messageSent(); - } + runOnUiThread(new Runnable() { + @Override + public void run() { + mConversationFragment.messageSent(); + } + }); } @Override @@ -1699,15 +1702,14 @@ public class ConversationActivity extends XmppActivity runOnUiThread(new Runnable() { @Override public void run() { + mConversationFragment.doneSendingPgpMessage(); Toast.makeText(ConversationActivity.this, R.string.unable_to_connect_to_keychain, Toast.LENGTH_SHORT ).show(); } }); - if (mConversationFragment != null) { - mConversationFragment.doneSendingPgpMessage(); - } + } }); }