You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by le...@apache.org on 2014/06/23 18:38:23 UTC
svn commit: r1604871 -
/pdfbox/branches/1.8/jempbox/src/main/java/org/apache/jempbox/xmp/XMPSchema.java
Author: lehmi
Date: Mon Jun 23 16:38:22 2014
New Revision: 1604871
URL: http://svn.apache.org/r1604871
Log:
PDFBOX-710: avoid NPE as proposed by Peter Lenahan
Modified:
pdfbox/branches/1.8/jempbox/src/main/java/org/apache/jempbox/xmp/XMPSchema.java
Modified: pdfbox/branches/1.8/jempbox/src/main/java/org/apache/jempbox/xmp/XMPSchema.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/jempbox/src/main/java/org/apache/jempbox/xmp/XMPSchema.java?rev=1604871&r1=1604870&r2=1604871&view=diff
==============================================================================
--- pdfbox/branches/1.8/jempbox/src/main/java/org/apache/jempbox/xmp/XMPSchema.java (original)
+++ pdfbox/branches/1.8/jempbox/src/main/java/org/apache/jempbox/xmp/XMPSchema.java Mon Jun 23 16:38:22 2014
@@ -397,7 +397,10 @@ public class XMPSchema
}
Element liElement = schema.getOwnerDocument().createElement("rdf:li");
XMLUtil.setStringValue(liElement, bagValue);
- bagElement.appendChild(liElement);
+ if (bagElement != null)
+ {
+ bagElement.appendChild(liElement);
+ }
}
/**
@@ -574,7 +577,10 @@ public class XMPSchema
bagElement = schema.getOwnerDocument().createElement("rdf:Seq");
contElement.appendChild(bagElement);
}
- bagElement.appendChild(seqValue.getElement());
+ if (bagElement != null)
+ {
+ bagElement.appendChild(seqValue.getElement());
+ }
}
/**
@@ -608,7 +614,6 @@ public class XMPSchema
retval = Collections.unmodifiableList(retval);
}
}
-
return retval;
}
@@ -641,7 +646,6 @@ public class XMPSchema
retval = Collections.unmodifiableList(retval);
}
}
-
return retval;
}