abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r422009 - /incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
Date Fri, 14 Jul 2006 20:08:51 GMT
Author: jmsnell
Date: Fri Jul 14 13:08:51 2006
New Revision: 422009

URL: http://svn.apache.org/viewvc?rev=422009&view=rev
Log:
entry.getContent() used to throw a NPE when XML or XHTML content is empty. 
Strictly speaking, this is ok, but it's not really necessary.  Fixed.

Modified:
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java?rev=422009&r1=422008&r2=422009&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
Fri Jul 14 13:08:51 2006
@@ -209,9 +209,11 @@
     } else if (Type.HTML.equals(type)) {
       val = getText();
     } else if (Type.XHTML.equals(type)) {
-      val = ((FOMDiv)this.getFirstChildWithName(Constants.DIV)).getInternalValue();
+      FOMDiv div = (FOMDiv)this.getFirstChildWithName(Constants.DIV);
+      if (div != null) val = div.getInternalValue();
     } else if (Type.XML.equals(type)) {
-      val = this.getFirstElement().toString();
+      OMElement el = this.getFirstElement();
+      if (el != null) val = el.toString();
     } else if (Type.MEDIA.equals(type)) {
       val = getText();
     }



Mime
View raw message