Merge pull request #1343 from TomHennen/fix1339

fix NPE in ItemFragment. fixes AntennaPod/AntennaPod#1339
This commit is contained in:
Tom Hennen 2015-11-06 15:43:43 -05:00
commit c5d99a84b2
1 changed files with 9 additions and 1 deletions

View File

@ -324,8 +324,16 @@ public class ItemFragment extends Fragment {
}
private void updateAppearance() {
if (item == null) {
Log.d(TAG, "updateAppearance item is null");
return;
}
txtvTitle.setText(item.getTitle());
txtvPublished.setText(DateUtils.formatDateTime(getActivity(), item.getPubDate().getTime(), DateUtils.FORMAT_ABBREV_ALL));
if (item.getPubDate() != null) {
txtvPublished.setText(DateUtils.formatDateTime(getActivity(), item.getPubDate().getTime(), DateUtils.FORMAT_ABBREV_ALL));
}
Glide.with(getActivity())
.load(item.getImageUri())