Skip to content

Commit 44dd424

Browse files
committed
PDFBOX-5288: fix push/pop imbalance
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1930735 13f79535-47bb-0310-9956-ffa450edef68
1 parent 9225f72 commit 44dd424

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

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

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -536,15 +536,22 @@ private void manageStructuredType(XMPMetadata xmp, Element property, String pref
536536
Element inner = DomHelper.getFirstChildElement(property);
537537
if (inner != null)
538538
{
539-
nsFinder.push(inner);
540-
AbstractStructuredType ast = parseLiDescription(xmp, DomHelper.getQName(property), inner);
541-
if (ast == null)
539+
try
542540
{
543-
throw new XmpParsingException(ErrorType.Format, "inner element should contain child elements : "
544-
+ inner);
541+
nsFinder.push(inner);
542+
AbstractStructuredType ast = parseLiDescription(xmp, DomHelper.getQName(property), inner);
543+
if (ast == null)
544+
{
545+
throw new XmpParsingException(ErrorType.Format, "inner element should contain child elements : "
546+
+ inner);
547+
}
548+
ast.setPrefix(prefix);
549+
container.addProperty(ast);
550+
}
551+
finally
552+
{
553+
nsFinder.pop();
545554
}
546-
ast.setPrefix(prefix);
547-
container.addProperty(ast);
548555
}
549556
}
550557
}

0 commit comments

Comments
 (0)