~singpolyma/cheogram-android

abfe1f1dbd85d9b8e88b3b4a7e86e0bcf92c0465 — Daniel Gultsch 2 years ago e455ed4
do not show toast when activity is gone. fixes #4335
1 files changed, 5 insertions(+), 1 deletions(-)

M src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
M src/main/java/eu/siacs/conversations/ui/ConversationFragment.java => src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +5 -1
@@ 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)));
                    }
                });