From 06cf451ca70cc0f1e6452762735794241411bee1 Mon Sep 17 00:00:00 2001 From: Siedlerchr Date: Fri, 18 Nov 2022 18:09:18 +0100 Subject: [PATCH] Do not break on Exception in XMP parser Fixes #9383 Workaround for IllegalArgumentException --- src/main/java/org/jabref/logic/xmp/XmpUtilShared.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/jabref/logic/xmp/XmpUtilShared.java b/src/main/java/org/jabref/logic/xmp/XmpUtilShared.java index 7aa607917ed..4957a11cfab 100644 --- a/src/main/java/org/jabref/logic/xmp/XmpUtilShared.java +++ b/src/main/java/org/jabref/logic/xmp/XmpUtilShared.java @@ -9,7 +9,6 @@ import org.apache.xmpbox.XMPMetadata; import org.apache.xmpbox.xml.DomXmpParser; -import org.apache.xmpbox.xml.XmpParsingException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -30,7 +29,8 @@ protected static XMPMetadata parseXmpMetadata(InputStream is) throws IOException DomXmpParser parser = new DomXmpParser(); meta = parser.parse(is); return meta; - } catch (XmpParsingException e) { + } catch (Exception e) { + // bad style to catch Exception but as this is called in a loop we do not want to break here when any schema encounters an error throw new IOException(e); } }