commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r373612 - /jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/RSSFeedParser.java
Date Mon, 30 Jan 2006 22:27:46 GMT
Author: mvdb
Date: Mon Jan 30 14:27:44 2006
New Revision: 373612

URL: http://svn.apache.org/viewcvs?rev=373612&view=rev
Log:
In using the feedparser API I've encountered a number of RSS feeds that are
missing the lenght attribute for enclosures. This causes feedparser to throw a
NPE. The standard does say that length is a required element, but in practice
it's being ignored.

Applied bugzilla issue 38225.
Thanx Andrew McCall andrew.mccall at goroam.net

Modified:
    jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/RSSFeedParser.java

Modified: jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/RSSFeedParser.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/RSSFeedParser.java?rev=373612&r1=373611&r2=373612&view=diff
==============================================================================
--- jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/RSSFeedParser.java
(original)
+++ jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/RSSFeedParser.java
Mon Jan 30 14:27:44 2006
@@ -297,7 +297,9 @@
         String type = element.getAttributeValue( "type" );
         String href = element.getAttributeValue( "url" );
         String title = null;
-        long length = Integer.parseInt( element.getAttributeValue( "length" ) );
+        long length = 0;
+        if (element.getAttributeValue("length") != null)
+        	length = Integer.parseInt( element.getAttributeValue( "length" ) );
 
         linkFeedParserListener.onLink( state,
                                        rel,



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message