From edb355da803fdea378efb6548f06050eb894bbc1 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Tue, 26 May 2020 11:09:19 +0800 Subject: [PATCH] android:DoricPanelFragment fix npe --- .../src/main/java/pub/doric/DoricPanelFragment.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 afacbd98..90c5e828 100644 --- a/doric-android/doric/src/main/java/pub/doric/DoricPanelFragment.java +++ b/doric-android/doric/src/main/java/pub/doric/DoricPanelFragment.java @@ -64,10 +64,14 @@ public class DoricPanelFragment extends Fragment implements IDoricNavigator { loadJSBundle(); } else { DoricPanel panel = view.findViewById(R.id.doric_panel); - if (doricPanel != view.findViewById(R.id.doric_panel)) { - DoricContext context = doricPanel.getDoricContext(); - panel.config(context); + if (doricPanel != panel) { + DoricContext doricContext = doricPanel.getDoricContext(); doricPanel = panel; + if (doricContext == null) { + loadJSBundle(); + } else { + panel.config(doricContext); + } } } }