prevent NPE by removing log statement

This commit is contained in:
Tom Hennen 2016-04-02 15:11:30 -04:00
parent 90ae1d1b71
commit 77ad34ce56
1 changed files with 3 additions and 8 deletions

View File

@ -102,17 +102,12 @@ public class SubscriptionsAdapter extends BaseAdapter implements AdapterView.OnI
final Feed feed = (Feed) getItem(position); final Feed feed = (Feed) getItem(position);
if (feed == null) return null; if (feed == null) return null;
String title = feed.getTitle(); holder.feedTitle.setText(feed.getTitle());
long feedId = feed.getId();
int counter = itemAccess.getFeedCounter(feedId);
Uri imageUri = feed.getImageUri();
Log.i(TAG, String.format("Title: %s id: %d counter: %d uri: %s", title, feedId, counter, imageUri.toString()));
holder.feedTitle.setText(title);
holder.feedTitle.setVisibility(View.VISIBLE); holder.feedTitle.setVisibility(View.VISIBLE);
holder.count.setPrimaryText(String.valueOf(counter)); holder.count.setPrimaryText(String.valueOf(itemAccess.getFeedCounter(feed.getId())));
holder.count.setVisibility(View.VISIBLE); holder.count.setVisibility(View.VISIBLE);
Glide.with(mainActivityRef.get()) Glide.with(mainActivityRef.get())
.load(imageUri) .load(feed.getImageUri())
.error(R.color.light_gray) .error(R.color.light_gray)
.diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY)
.fitCenter() .fitCenter()