do not show toast when activity is gone. fixes #4335
This commit is contained in:
parent
e455ed4f1a
commit
abfe1f1dbd
|
@ -710,8 +710,12 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void error(final int error, Message message) {
|
public void error(final int error, final Message message) {
|
||||||
hidePrepareFileToast(prepareFileToast);
|
hidePrepareFileToast(prepareFileToast);
|
||||||
|
final ConversationsActivity activity = ConversationFragment.this.activity;
|
||||||
|
if (activity == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
activity.runOnUiThread(() -> activity.replaceToast(getString(error)));
|
activity.runOnUiThread(() -> activity.replaceToast(getString(error)));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue