diff --git a/doric-android/doric/src/main/java/pub/doric/DoricPanelFragment.java b/doric-android/doric/src/main/java/pub/doric/DoricPanelFragment.java index 03a44986..37447652 100644 --- a/doric-android/doric/src/main/java/pub/doric/DoricPanelFragment.java +++ b/doric-android/doric/src/main/java/pub/doric/DoricPanelFragment.java @@ -175,6 +175,9 @@ public class DoricPanelFragment extends Fragment implements IDoricNavigator { DoricJSLoaderManager.getInstance().loadJSBundle(source).setCallback(new AsyncResult.Callback() { @Override public void onResult(String result) { + if (getActivity() == null) { + return; + } doricPanel.config(result, alias, extra); DoricContext context = doricPanel.getDoricContext(); context.setDoricNavigator(DoricPanelFragment.this); @@ -185,6 +188,9 @@ public class DoricPanelFragment extends Fragment implements IDoricNavigator { @Override public void onError(Throwable t) { + if (getActivity() == null) { + return; + } DoricLog.e("DoricPanelFragment load JS error:" + t.getLocalizedMessage()); showError(); }