Skip to content

Commit

Permalink
Bugfix: check for null before calling Base64 encode string from java.…
Browse files Browse the repository at this point in the history
…util
  • Loading branch information
Sunjeet committed Mar 3, 2023
1 parent e63ffb2 commit 78532e0
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ List<Field> createObjectFields(HollowEffigy effigy) {
fieldValue = typeDataAccess.readBoolean(effigy.ordinal, i);
break;
case BYTES:
fieldValue = base64.encodeToString(typeDataAccess.readBytes(effigy.ordinal, i));
byte[] fieldValueBytes = typeDataAccess.readBytes(effigy.ordinal, i);
if (fieldValueBytes == null || fieldValueBytes.length == 0) {
fieldValue = fieldValueBytes;
} else {
fieldValue = base64.encodeToString(fieldValueBytes);
}
break;
case DOUBLE:
fieldValue = Double.valueOf(typeDataAccess.readDouble(effigy.ordinal, i));
Expand Down

0 comments on commit 78532e0

Please sign in to comment.