Prevent crash

This commit is contained in:
M66B
2018-09-04 18:56:56 +00:00
parent d8c2c41a67
commit 01710cbcb7

View File

@@ -62,7 +62,11 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
}
public void load(final Fragment fragment, Bundle args) {
run(fragment.getContext(), fragment.getViewLifecycleOwner(), args);
try {
run(fragment.getContext(), fragment.getViewLifecycleOwner(), args);
} catch (IllegalStateException ex) {
Log.w(Helper.TAG, ex + "\n" + Log.getStackTraceString(ex));
}
}
@OnLifecycleEvent(Lifecycle.Event.ON_START)