* [android] fix NPE

Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/f63bf2cd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/f63bf2cd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/f63bf2cd

Branch: refs/heads/0.16-dev
Commit: f63bf2cd87cc5845fca7b271e1e6e94def779743
Parents: c964a90
Author: 莫绪旻 <xumin....@alibaba-inc.com>
Authored: Mon Jul 24 13:18:55 2017 +0800
Committer: 莫绪旻 <xumin....@alibaba-inc.com>
Committed: Mon Jul 24 13:18:55 2017 +0800

----------------------------------------------------------------------
 .../com/taobao/weex/ui/component/list/WXListComponent.java    | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f63bf2cd/android/sdk/src/main/java/com/taobao/weex/ui/component/list/WXListComponent.java
----------------------------------------------------------------------
diff --git 
a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/WXListComponent.java
 
b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/WXListComponent.java
index 9a52dfb..3b89819 100644
--- 
a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/WXListComponent.java
+++ 
b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/WXListComponent.java
@@ -92,15 +92,14 @@ public class WXListComponent extends 
BasicListComponent<BounceRecyclerView> {
     setRefreshOrLoading(child);
 
     // Synchronize DomObject's attr to Component and Native View
-    if(mDomObject.getColumnWidth() != mColumnWidth ||
-            mDomObject.getColumnCount() != mColumnCount ||
-            mDomObject.getColumnGap() != mColumnGap) {
+    if(mDomObject != null && getHostView() != null && (mColumnWidth != 
mDomObject.getColumnWidth() ||
+            mColumnCount != mDomObject.getColumnCount() ||
+            mColumnGap != mDomObject.getColumnGap())) {
       updateRecyclerAttr();
       getHostView().getInnerView().initView(getContext(), 
mLayoutType,mColumnCount,mColumnGap,getOrientation());
     }
   }
 
-
   /**
    * Setting refresh view and loading view
    *

Reply via email to