From a786977b8003b83ca1ecab430d9fca88f0d4a657 Mon Sep 17 00:00:00 2001 From: pengfeizhou Date: Wed, 3 Feb 2021 11:04:48 +0800 Subject: [PATCH] Android:protect type error --- .../src/main/java/pub/doric/shader/GroupNode.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 8388f1d9..1e943284 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 @@ -43,10 +43,15 @@ public abstract class GroupNode extends SuperNode { @Override protected void blend(F view, String name, JSValue prop) { if ("children".equals(name)) { - JSArray ids = prop.asArray(); mChildViewIds.clear(); - for (int i = 0; i < ids.size(); i++) { - mChildViewIds.add(ids.get(i).asString().value()); + if (prop.isArray()) { + JSArray ids = prop.asArray(); + for (int i = 0; i < ids.size(); i++) { + JSValue value = ids.get(i); + if (value.isString()) { + mChildViewIds.add(value.asString().value()); + } + } } } else { super.blend(view, name, prop);