diff --git a/java/org/servalproject/servaldna/AbstractId.java b/java/org/servalproject/servaldna/AbstractId.java index 2ecdf12c..4d49c2b3 100644 --- a/java/org/servalproject/servaldna/AbstractId.java +++ b/java/org/servalproject/servaldna/AbstractId.java @@ -46,6 +46,8 @@ public abstract class AbstractId { private final byte[] binary; public AbstractId(String hex) throws InvalidHexException { + if (hex==null) + throw new InvalidHexException(this, "null is not a invalid hex value"); if (hex.length() != getBinarySize()*2) throw new InvalidHexException(this, "invalid length " + hex.length() + " (should be " + (getBinarySize() * 2) + ") of '" + hex + "'"); binary = new byte[getBinarySize()];