Author: tilman
Date: Tue Dec 2 16:05:49 2025
New Revision: 1930198
Log:
PDFBOX-5660: improve exception message
Modified:
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java
Modified:
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java
==============================================================================
---
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java
Tue Dec 2 16:05:43 2025 (r1930197)
+++
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java
Tue Dec 2 16:05:49 2025 (r1930198)
@@ -469,9 +469,10 @@ public class DomXmpParser
{
// not an array
String whatFound = "nothing";
- if (property.getFirstChild() != null)
+ Node firstChild = property.getFirstChild();
+ if (firstChild != null)
{
- whatFound = property.getFirstChild().getClass().getName();
+ whatFound = firstChild instanceof Text ? "Text" :
firstChild.getClass().getName();
}
throw new XmpParsingException(ErrorType.Format, "Invalid array
definition, expecting " + type.card()
+ " and found "