1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-01 04:35:57 +00:00

Prevent crash

This commit is contained in:
M66B 2018-11-06 07:30:41 +00:00
parent 6c72fe8724
commit b678d9ac34
3 changed files with 4 additions and 8 deletions

View file

@ -44,7 +44,7 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
void onLoaded();
void onError(Context context, Throwable ex);
void onError(Throwable ex);
}
BoundaryCallbackMessages(LifecycleOwner owner, ViewModelBrowse _model, IBoundaryCallbackMessages intf) {
@ -102,7 +102,7 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
handler.post(new Runnable() {
@Override
public void run() {
intf.onError(model.getContext(), ex);
intf.onError(ex);
}
});
} finally {

View file

@ -1099,7 +1099,7 @@ public class FragmentMessages extends FragmentEx {
}
@Override
public void onError(Context context, Throwable ex) {
public void onError(Throwable ex) {
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
new DialogBuilderLifecycle(getContext(), getViewLifecycleOwner())
.setMessage(Helper.formatThrowable(ex))
@ -1143,7 +1143,7 @@ public class FragmentMessages extends FragmentEx {
}
@Override
public void onError(Context context, Throwable ex) {
public void onError(Throwable ex) {
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
new DialogBuilderLifecycle(getContext(), getViewLifecycleOwner())
.setMessage(Helper.formatThrowable(ex))

View file

@ -79,10 +79,6 @@ public class ViewModelBrowse extends ViewModel {
imessages = null;
}
Context getContext() {
return context;
}
void load() throws MessagingException, IOException {
DB db = DB.getInstance(context);
EntityFolder folder = db.folder().getFolder(fid);