1. bugfix: NPE
This commit is contained in:
@@ -25,7 +25,13 @@ public class AppsAdapter extends BaseAdapter {
|
||||
private List< AppInfo > mAppInfos;
|
||||
|
||||
public AppsAdapter( List< AppInfo > appInfos ) {
|
||||
this.mAppInfos = new ArrayList<>( appInfos );
|
||||
this.mAppInfos = new ArrayList<>();
|
||||
for ( AppInfo appInfo : appInfos ) {
|
||||
if ( appInfo == null ) {
|
||||
continue;
|
||||
}
|
||||
mAppInfos.add( appInfo );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -53,9 +59,6 @@ public class AppsAdapter extends BaseAdapter {
|
||||
holder = ( ( AppViewHolder ) convertView.getTag() );
|
||||
}
|
||||
AppInfo appInfo = getItem( position );
|
||||
if ( appInfo == null ) {
|
||||
return holder.mItemView;
|
||||
}
|
||||
if ( appInfo.getIconResId() <= 0 ) {
|
||||
if ( appInfo.getIcon() != null ) {
|
||||
holder.mIcon.setImageDrawable( appInfo.getIcon() );
|
||||
|
||||
Reference in New Issue
Block a user