[ 
https://issues.apache.org/jira/browse/WEEX-669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16698588#comment-16698588
 ] 

ASF GitHub Bot commented on WEEX-669:
-------------------------------------

YorkShen commented on a change in pull request #1816: [WEEX-669][android] fix 
slider crash when adapter is null
URL: https://github.com/apache/incubator-weex/pull/1816#discussion_r236147587
 
 

 ##########
 File path: android/sdk/src/main/java/com/taobao/weex/ui/component/WXSlider.java
 ##########
 @@ -214,7 +214,14 @@ public void run() {
 
   @Override
   public void setLayout(WXComponent component) {
-    mAdapter.setLayoutDirectionRTL(this.isNativeLayoutRTL());
+    if (TextUtils.isEmpty(component.getComponentType())
 
 Review comment:
   Change to this?
   ```
   if(!TextUtils.isEmpty(component.getComponentType())&&...&&...){
       if (mAdapter != null) {
         mAdapter.setLayoutDirectionRTL(this.isNativeLayoutRTL());
       }
       super.setLayout(component);
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> [android] crash when slider mAdapter null
> -----------------------------------------
>
>                 Key: WEEX-669
>                 URL: https://issues.apache.org/jira/browse/WEEX-669
>             Project: Weex
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 0.19
>            Reporter: KAI TIAN
>            Assignee: YorkShen
>            Priority: Major
>             Fix For: 0.19
>
>
> java.lang.NullPointerException: Attempt to invoke virtual method 'void 
> com.taobao.weex.ui.view.WXCirclePageAdapter.setLayoutDirectionRTL(boolean)' 
> on a null object reference
> at com.taobao.weex.ui.component.WXSlider.setLayout(WXSlider.java:217)
> at 
> com.taobao.weex.ui.action.GraphicActionLayout.executeAction(GraphicActionLayout.java:44)
> at 
> com.taobao.weex.ui.action.BasicGraphicAction.run(BasicGraphicAction.java:68)
> at android.os.Handler.handleCallback(Handler.java:751)
> at android.os.Handler.dispatchMessage(Handler.java:95)
> at android.os.Looper.loop(Looper.java:154)
> at android.app.ActivityThread.main(ActivityThread.java:6195)
> at java.lang.reflect.Method.invoke(Native Method)
> at 
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
> at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to