Skip to content

Commit 6609e98

Browse files
committed
PDFBOX-6321: avoid NPE
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1941364 13f79535-47bb-0310-9956-ffa450edef68
1 parent de96a61 commit 6609e98

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,11 @@ private void parseDescriptionInner(XMPMetadata xmp, Element description, Complex
643643
{
644644
String name = property.getLocalName();
645645
PropertyType dtype = checkPropertyDefinition(tm, DomHelper.getQName(property), null);
646+
if (dtype == null)
647+
{
648+
throw new XmpParsingException(ErrorType.NoType,
649+
"Property '" + name + "' not defined in " + property.getNamespaceURI());
650+
}
646651
PropertyType ptype = tm.getStructuredPropMapping(dtype.type()).getPropertyType(name);
647652
// create property
648653
createProperty(xmp, property, ptype, parentContainer);

0 commit comments

Comments
 (0)