Make sure custom XML provided by some anonymous developer is at least halfway valid ;-)

This commit is contained in:
Jochen Stärk
2017-10-28 17:12:01 +02:00
parent 7ebb344401
commit 77df03a98b

View File

@@ -10,6 +10,11 @@ public class CustomXMLProvider implements IXMLProvider {
}
public void setXML(byte[] newData) {
String zf=new String(newData);
if (!zf.contains("<rsm:CrossIndustry")) {
throw new RuntimeException("ZUGFeRD XML does not contain <rsm:CrossIndustry and can thus not be valid");
}
zugferdData=newData;
}