Skip to content

Commit 6defade

Browse files
committed
PDFBOX-6130: sonar fix
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1930765 13f79535-47bb-0310-9956-ffa450edef68
1 parent 6426a75 commit 6defade

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -991,13 +991,10 @@ private Element findDescriptionsParent(Element root) throws XmpParsingException
991991
// empty description
992992
throw new XmpParsingException(ErrorType.Format, "No rdf description found in xmp");
993993
}
994-
else if (nl.getLength() > 1)
994+
else if (nl.getLength() > 1 && strictParsing)
995995
{
996996
// only expect one element
997-
if (strictParsing)
998-
{
999-
throw new XmpParsingException(ErrorType.Format, "More than one element found in x:xmpmeta");
1000-
}
997+
throw new XmpParsingException(ErrorType.Format, "More than one element found in x:xmpmeta");
1001998
}
1002999
// find element (there may be a text before the element)
10031000
for (int i = 0; i < nl.getLength(); ++i)

0 commit comments

Comments
 (0)