Check for null values

This commit is contained in:
norman 2012-07-12 07:51:15 +02:00
parent bd1bc534d8
commit c7e276efe0
2 changed files with 6 additions and 0 deletions

View File

@ -28,6 +28,9 @@ class CompactObjectInputStream extends ObjectInputStream {
CompactObjectInputStream(InputStream in, ClassResolver classResolver) throws IOException {
super(in);
if (classResolver == null) {
throw new NullPointerException("classResolver");
}
this.classResolver = classResolver;
}

View File

@ -92,6 +92,9 @@ public class ObjectDecoder extends LengthFieldBasedFrameDecoder {
*/
public ObjectDecoder(int maxObjectSize, ClassResolver classResolver) {
super(maxObjectSize, 0, 4, 0, 4);
if (classResolver == null) {
throw new NullPointerException("classResolver");
}
this.classResolver = classResolver;
}