diff --git a/src/main/java/io/lettuce/core/codec/ByteArrayCodec.java b/src/main/java/io/lettuce/core/codec/ByteArrayCodec.java index c8a9cffd06..bcecd3d283 100644 --- a/src/main/java/io/lettuce/core/codec/ByteArrayCodec.java +++ b/src/main/java/io/lettuce/core/codec/ByteArrayCodec.java @@ -90,9 +90,11 @@ public ByteBuffer encodeValue(byte[] value) { } private static byte[] getBytes(ByteBuffer buffer) { + if (buffer == null) { + return EMPTY; + } int remaining = buffer.remaining(); - if (remaining == 0) { return EMPTY; }