Skip to content

Commit

Permalink
Do not break on Exception in XMP parser
Browse files Browse the repository at this point in the history
Fixes #9383

Workaround for IllegalArgumentException
  • Loading branch information
Siedlerchr committed Nov 18, 2022
1 parent 07ea998 commit 06cf451
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/jabref/logic/xmp/XmpUtilShared.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
}
}
Expand Down

0 comments on commit 06cf451

Please sign in to comment.