Skip to content

Commit

Permalink
Handle NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
thachlp committed Jul 1, 2024
1 parent e5b75da commit c525619
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/io/lettuce/core/codec/ByteArrayCodec.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c525619

Please sign in to comment.