abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r588717 - /incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/json/JSONUtil.java
Date Fri, 26 Oct 2007 17:17:28 GMT
Author: jmsnell
Date: Fri Oct 26 10:17:27 2007
New Revision: 588717

URL: http://svn.apache.org/viewvc?rev=588717&view=rev
Log:
fix null pointer exception

Modified:
    incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/json/JSONUtil.java

Modified: incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/json/JSONUtil.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/json/JSONUtil.java?rev=588717&r1=588716&r2=588717&view=diff
==============================================================================
--- incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/json/JSONUtil.java
(original)
+++ incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/json/JSONUtil.java
Fri Oct 26 10:17:27 2007
@@ -275,8 +275,10 @@
         jstream.writeField("xml:base", element.getResolvedBaseUri());
       Person person = (Person)element;      
       jstream.writeField("name",person.getName());
-      jstream.writeField("email",person.getEmail());
-      jstream.writeField("uri",person.getUriElement().getResolvedValue());
+      if (person.getEmail() != null)
+        jstream.writeField("email",person.getEmail());
+      if (person.getUri() != null)
+        jstream.writeField("uri",person.getUriElement().getResolvedValue());
       writeExtensions((ExtensibleElement)element,jstream);
       jstream.endObject();
     } else if (element instanceof Service) {



Mime
View raw message