Skip to content

Commit

Permalink
added null checks to key and dummy string serializers
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Alfonsi committed Dec 7, 2023
1 parent b7fcac7 commit 90c0f9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ public byte[] serialize(IndicesRequestCache.Key object) {

@Override
public IndicesRequestCache.Key deserialize(byte[] bytes) {
if (bytes == null) {
return null;
}
try {
BytesStreamInput is = new BytesStreamInput(bytes, 0, bytes.length);
return irc.new Key(is);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,9 @@ public byte[] serialize(String object) {

@Override
public String deserialize(byte[] bytes) {
if (bytes == null) {
return null;
}
return new String(bytes, charset);
}

Expand Down

0 comments on commit 90c0f9a

Please sign in to comment.