Fixed crash that occured when loading a FeedItem without an enclosure

from the DB
This commit is contained in:
daniel oeh 2012-06-23 23:34:00 +02:00
parent dc32fb843d
commit d8d4d28602
2 changed files with 6 additions and 4 deletions

View File

@ -415,9 +415,11 @@ public class FeedManager {
.getColumnIndex(PodDBAdapter.KEY_CONTENT_ENCODED)));
item.setPubDate(new Date(itemlistCursor.getLong(itemlistCursor
.getColumnIndex(PodDBAdapter.KEY_PUBDATE))));
item.setMedia(adapter.getFeedMedia(itemlistCursor
.getLong(itemlistCursor
.getColumnIndex(PodDBAdapter.KEY_MEDIA)), item));
long mediaId = itemlistCursor.getLong(itemlistCursor
.getColumnIndex(PodDBAdapter.KEY_MEDIA));
if (mediaId != 0) {
item.setMedia(adapter.getFeedMedia(mediaId, item));
}
item.read = (itemlistCursor.getInt(itemlistCursor
.getColumnIndex(PodDBAdapter.KEY_READ)) > 0) ? true
: false;

View File

@ -16,7 +16,7 @@ public class FeedItemMenuHandler {
private FeedItemMenuHandler() {
}
// TODO Fix crash when media is null
public static boolean onPrepareMenu(Menu menu, FeedItem selectedItem) {
FeedManager manager = FeedManager.getInstance();