diff --git a/doric-android/doric/src/main/java/pub/doric/plugin/ShaderPlugin.java b/doric-android/doric/src/main/java/pub/doric/plugin/ShaderPlugin.java index 19b68063..5580b387 100644 --- a/doric-android/doric/src/main/java/pub/doric/plugin/ShaderPlugin.java +++ b/doric-android/doric/src/main/java/pub/doric/plugin/ShaderPlugin.java @@ -15,6 +15,8 @@ */ package pub.doric.plugin; +import android.app.Activity; +import android.os.Build; import android.text.TextUtils; import android.util.Log; @@ -53,6 +55,12 @@ public class ShaderPlugin extends DoricJavaPlugin { getDoricContext().getDriver().asyncCall(new Callable() { @Override public Object call() throws Exception { + if (getDoricContext().getContext() instanceof Activity) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 + && ((Activity) getDoricContext().getContext()).isDestroyed()) { + return null; + } + } String viewId = jsObject.getProperty("id").asString().value(); RootNode rootNode = getDoricContext().getRootNode(); if (TextUtils.isEmpty(rootNode.getId())) { diff --git a/doric-android/doric/src/main/java/pub/doric/shader/GroupNode.java b/doric-android/doric/src/main/java/pub/doric/shader/GroupNode.java index c940865c..800eb9b8 100644 --- a/doric-android/doric/src/main/java/pub/doric/shader/GroupNode.java +++ b/doric-android/doric/src/main/java/pub/doric/shader/GroupNode.java @@ -18,6 +18,7 @@ package pub.doric.shader; import android.view.ViewGroup; import pub.doric.DoricContext; +import pub.doric.utils.DoricLog; import com.github.pengfeizhou.jscore.JSArray; import com.github.pengfeizhou.jscore.JSObject; @@ -61,6 +62,10 @@ public abstract class GroupNode extends SuperNode { for (int idx = 0; idx < mChildViewIds.size(); idx++) { String id = mChildViewIds.get(idx); JSObject model = getSubModel(id); + if (model == null) { + DoricLog.e("configChildNode error when Group is %s and child is %s", this.getId(), id); + continue; + } String type = model.getProperty("type").asString().value(); if (idx < mChildNodes.size()) { ViewNode oldNode = mChildNodes.get(idx);