do not show toast when activity is gone. fixes #4335

This commit is contained in:
Daniel Gultsch 2022-07-09 14:46:18 +02:00
parent e455ed4f1a
commit abfe1f1dbd

View file

@ -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)));
}
});