throw an exception if there are no items in the feed

This commit is contained in:
Athou
2013-06-12 05:12:38 +02:00
parent c6a9fdc8c3
commit cabea47995

View File

@@ -73,6 +73,11 @@ public class FeedParser {
feed.setUrl(feedUrl);
feed.setLink(rss.getLink());
List<SyndEntry> items = rss.getEntries();
if (items.isEmpty()) {
throw new FeedException("No items in the feed.");
}
for (SyndEntry item : items) {
FeedEntry entry = new FeedEntry();