Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
[Android] Fix potential NPE (#2662)
Browse files Browse the repository at this point in the history
  • Loading branch information
YorkShen authored and lucky-chen committed Jul 9, 2019
1 parent ce01b5b commit 159ccdc
Showing 1 changed file with 2 additions and 4 deletions.
Expand Up @@ -24,12 +24,10 @@
import android.view.MotionEvent;
import android.view.View;
import android.widget.HorizontalScrollView;

import com.taobao.weex.ui.view.gesture.WXGesture;
import com.taobao.weex.ui.view.gesture.WXGestureObservable;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

public class WXHorizontalScrollView extends HorizontalScrollView implements IWXScroller, WXGestureObservable {

Expand Down Expand Up @@ -77,7 +75,7 @@ public void destroy() {

public void addScrollViewListener(ScrollViewListener scrollViewListener) {
if (mScrollViewListeners == null) {
mScrollViewListeners = new ArrayList<>();
mScrollViewListeners = new CopyOnWriteArrayList<>();
}
if (!mScrollViewListeners.contains(scrollViewListener)) {
mScrollViewListeners.add(scrollViewListener);
Expand Down

0 comments on commit 159ccdc

Please sign in to comment.