Author: nickarls
Date: 2008-09-22 05:32:14 -0400 (Mon, 22 Sep 2008)
New Revision: 9094
Modified:
trunk/src/rss/org/jboss/seam/rss/ui/UIEntry.java
trunk/src/rss/org/jboss/seam/rss/ui/UIFeed.java
Log:
Fixed NPEs for dates
Modified: trunk/src/rss/org/jboss/seam/rss/ui/UIEntry.java
===================================================================
--- trunk/src/rss/org/jboss/seam/rss/ui/UIEntry.java 2008-09-22 09:31:47 UTC (rev 9093)
+++ trunk/src/rss/org/jboss/seam/rss/ui/UIEntry.java 2008-09-22 09:32:14 UTC (rev 9094)
@@ -60,8 +60,12 @@
Text summary = new Text(summaryFormat);
summary.setText(getSummary());
itemEntry.setDescriptionOrSummary(summary);
- itemEntry.setUpdatedDate(getUpdated(), new SimpleDateFormat(ATOM_DATE_FORMAT));
- itemEntry.setPubDate(getPublished(), new SimpleDateFormat(ATOM_DATE_FORMAT));
+ if (getUpdated() != null) {
+ itemEntry.setUpdatedDate(getUpdated(), new SimpleDateFormat(ATOM_DATE_FORMAT));
+ }
+ if (getPublished() != null) {
+ itemEntry.setPubDate(getPublished(), new SimpleDateFormat(ATOM_DATE_FORMAT));
+ }
channelFeed.addItem(itemEntry);
}
Modified: trunk/src/rss/org/jboss/seam/rss/ui/UIFeed.java
===================================================================
--- trunk/src/rss/org/jboss/seam/rss/ui/UIFeed.java 2008-09-22 09:31:47 UTC (rev 9093)
+++ trunk/src/rss/org/jboss/seam/rss/ui/UIFeed.java 2008-09-22 09:32:14 UTC (rev 9094)
@@ -62,7 +62,9 @@
channelFeed.setUid(getUid());
channelFeed.setTitle(getTitle());
channelFeed.setDescriptionOrSubtitle(getSubtitle());
- channelFeed.setPubDate(getUpdated(), new SimpleDateFormat(ATOM_DATE_FORMAT));
+ if (getUpdated() != null) {
+ channelFeed.setPubDate(getUpdated(), new SimpleDateFormat(ATOM_DATE_FORMAT));
+ }
channelFeed.addLink(getLink());
Contexts.getEventContext().set(FEED_IMPL_KEY, channelFeed);
}
Show replies by date