fix NPE in ItemFragment. fixes AntennaPod/AntennaPod#1339

This commit is contained in:
Tom Hennen 2015-11-05 17:19:13 -05:00
parent 3b003c60ab
commit 0ef38407e3
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())