* [android] fix null pointer crash
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/59edbc17 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/59edbc17 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/59edbc17 Branch: refs/heads/master Commit: 59edbc172f3053a0c12ee3d3286956ade35158f4 Parents: efc2d29 Author: wentao.swt <wentao....@alibaba-inc.com> Authored: Thu Apr 26 16:46:39 2018 +0800 Committer: YorkShen <shenyua...@gmail.com> Committed: Mon May 7 15:52:07 2018 +0800 ---------------------------------------------------------------------- .../src/main/java/com/taobao/weex/bridge/WXBridgeManager.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/59edbc17/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java ---------------------------------------------------------------------- diff --git a/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java b/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java index 33d1df2..71176b3 100644 --- a/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java +++ b/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java @@ -800,8 +800,11 @@ public class WXBridgeManager implements Callback, BactchExecutor { try{ execJSOnInstance(callback, instanceId, js, type); waitLatch.await(100, TimeUnit.MILLISECONDS); - return callback.getResult().toString(); - }catch (Exception e){ + if (callback != null && callback.getResult() != null) { + return callback.getResult().toString(); + } + return ""; + }catch (Throwable e){ WXLogUtils.e("syncCallExecJsOnInstance", e); return ""; }