Avoid NPE by checking zi.getXMP() is not null.

This commit is contained in:
langfr
2026-05-05 13:36:58 +01:00
parent ce60fa42d2
commit 189bbda416

View File

@@ -127,7 +127,13 @@ public class PDFValidator extends Validator {
final ZUGFeRDImporter zi = new ZUGFeRDImporter();
zi.doIgnoreCalculationErrors();//of course the calculation will still be schematron checked
zi.setInputStream(inputStream);
final String xmp = zi.getXMP().substring(zi.getXMP().indexOf('<'));
String xmp;
if (zi.getXMP() == null) {
xmp = null;
} else {
xmp = zi.getXMP().substring(zi.getXMP().indexOf('<'));
}
final Document docXMP;