You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ky...@apache.org on 2018/06/27 08:04:56 UTC

[2/2] incubator-weex git commit: [android][WEEX-474] when the app's WXInstance destroy, but Weex page call toast Toast , crash

[android][WEEX-474] when the app's WXInstance destroy, but Weex page call toast Toast ,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/31862066
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/31862066
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/31862066

Branch: refs/heads/master
Commit: 318620664095f29cfa9344f11bd5ff8a9f0d00a9
Parents: 15e8df0
Author: jianbai.gbj <ji...@alibaba-inc.com>
Authored: Tue Jun 26 15:52:36 2018 +0800
Committer: YorkShen <sh...@gmail.com>
Committed: Wed Jun 27 16:04:43 2018 +0800

----------------------------------------------------------------------
 .../src/main/java/com/taobao/weex/ui/module/WXModalUIModule.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/31862066/android/sdk/src/main/java/com/taobao/weex/ui/module/WXModalUIModule.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/module/WXModalUIModule.java b/android/sdk/src/main/java/com/taobao/weex/ui/module/WXModalUIModule.java
index 76ba718..3449359 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/module/WXModalUIModule.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/module/WXModalUIModule.java
@@ -61,7 +61,9 @@ public class WXModalUIModule extends WXSDKEngine.DestroyableModule {
 
   @JSMethod(uiThread = true)
   public void toast(JSONObject jsObj) {
-
+    if(mWXSDKInstance.getContext() == null){
+      return;
+    }
     String message = "";
     int duration = Toast.LENGTH_SHORT;
     if (jsObj != null) {