diff --git a/src/main/java/org/jivesoftware/site/DiscourseAPI.java b/src/main/java/org/jivesoftware/site/DiscourseAPI.java index a6fe25ae..abd8323f 100644 --- a/src/main/java/org/jivesoftware/site/DiscourseAPI.java +++ b/src/main/java/org/jivesoftware/site/DiscourseAPI.java @@ -115,8 +115,14 @@ public DownloadStatsRunnable(Map counts) { public void run() { final Map results = new HashMap<>(); - results.put(3, doSimpleQuery(3, 7)); - results.put(4, doSimpleQuery(4, 7)); + final Long a = doSimpleQuery(3, 7); + if (a != null) { + results.put(3, a); + } + final Long b = doSimpleQuery(4, 7); + if (b != null) { + results.put(4, b); + } // Replace all values in the object used by the website in one go. counts.clear(); diff --git a/src/main/java/org/jivesoftware/site/FeedManager.java b/src/main/java/org/jivesoftware/site/FeedManager.java index 70af86b7..85337e6e 100644 --- a/src/main/java/org/jivesoftware/site/FeedManager.java +++ b/src/main/java/org/jivesoftware/site/FeedManager.java @@ -93,7 +93,10 @@ public List getSummaryItems( String baseUrl, String feedUrl, in final List entries = getBlogFeedEntries( baseUrl, feedUrl ); for ( int i=0; i < entries.size() && i < max; i++ ) { - result.add( new SummaryFeedItem( getJSON( entries.get( i ).getLink() ) ) ); + final JSONObject entry = getJSON(entries.get(i).getLink()); + if (entry != null) { + result.add(new SummaryFeedItem(entry)); + } } return result;