diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2012-06-23 23:34:00 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2012-06-23 23:34:00 +0200 |
commit | d8d4d286028c734de2f684254e99c6484d586bff (patch) | |
tree | 6f81505d3975e514bb513d75eb7152d03f1b11dc /src/de/podfetcher | |
parent | dc32fb843d1408e2ca4a986caeb05dfa24a0f981 (diff) | |
download | AntennaPod-d8d4d286028c734de2f684254e99c6484d586bff.zip |
Fixed crash that occured when loading a FeedItem without an enclosure
from the DB
Diffstat (limited to 'src/de/podfetcher')
-rw-r--r-- | src/de/podfetcher/feed/FeedManager.java | 8 | ||||
-rw-r--r-- | src/de/podfetcher/util/FeedItemMenuHandler.java | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/de/podfetcher/feed/FeedManager.java b/src/de/podfetcher/feed/FeedManager.java index b3d5372c0..8ed227d3e 100644 --- a/src/de/podfetcher/feed/FeedManager.java +++ b/src/de/podfetcher/feed/FeedManager.java @@ -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; diff --git a/src/de/podfetcher/util/FeedItemMenuHandler.java b/src/de/podfetcher/util/FeedItemMenuHandler.java index 680520077..a159256ea 100644 --- a/src/de/podfetcher/util/FeedItemMenuHandler.java +++ b/src/de/podfetcher/util/FeedItemMenuHandler.java @@ -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(); |