Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.bigkoo.pickerview.adapter;

import android.support.annotation.NonNull;

import com.contrarywind.adapter.WheelAdapter;

import java.util.List;
Expand All @@ -9,7 +11,6 @@
* @param <T> the element type
*/
public class ArrayWheelAdapter<T> implements WheelAdapter {


// items
private List<T> items;
Expand All @@ -18,11 +19,11 @@ public class ArrayWheelAdapter<T> implements WheelAdapter {
* Constructor
* @param items the items
*/
public ArrayWheelAdapter(List<T> items) {
public ArrayWheelAdapter(@NonNull List<T> items) {
this.items = items;

}

@Override
public Object getItem(int index) {
if (index >= 0 && index < items.size()) {
Expand All @@ -33,7 +34,7 @@ public Object getItem(int index) {

@Override
public int getItemsCount() {
return items.size();
return items == null ? 0 : items.size();
}

@Override
Expand Down