diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index 1b334e5d4..2eb602257 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -710,8 +710,12 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke } @Override - public void error(final int error, Message message) { + public void error(final int error, final Message message) { hidePrepareFileToast(prepareFileToast); + final ConversationsActivity activity = ConversationFragment.this.activity; + if (activity == null) { + return; + } activity.runOnUiThread(() -> activity.replaceToast(getString(error))); } });