diff --git a/src/main/java/org/apache/commons/codec/binary/Base16.java b/src/main/java/org/apache/commons/codec/binary/Base16.java index 65f75c42e0..c3dfe8180d 100644 --- a/src/main/java/org/apache/commons/codec/binary/Base16.java +++ b/src/main/java/org/apache/commons/codec/binary/Base16.java @@ -17,6 +17,8 @@ package org.apache.commons.codec.binary; +import java.util.Objects; + import org.apache.commons.codec.CodecPolicy; /** @@ -138,6 +140,7 @@ public Base16(final boolean lowerCase) { */ private Base16(final boolean lowerCase, final byte[] encodeTable, final CodecPolicy decodingPolicy) { super(BYTES_PER_UNENCODED_BLOCK, BYTES_PER_ENCODED_BLOCK, 0, 0, PAD_DEFAULT, decodingPolicy); + Objects.requireNonNull(encodeTable, "encodeTable"); this.encodeTable = encodeTable; this.decodeTable = encodeTable == LOWER_CASE_ENCODE_TABLE ? LOWER_CASE_DECODE_TABLE : UPPER_CASE_DECODE_TABLE; }