Skip to content

Commit a088ba0

Browse files
committed
Fix handling of null byte array in query() result
1 parent 0ca416c commit a088ba0

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • src/main/java/com/laytonsmith/core/functions

‎src/main/java/com/laytonsmith/core/functions/SQL.java‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,12 @@ public Mixed exec(Target t, Environment environment, Mixed... args) throws Confi
263263
case Types.BINARY:
264264
case Types.VARBINARY:
265265
case Types.LONGVARBINARY:
266-
value = CByteArray.wrap(rs.getBytes(i), t);
266+
byte[] bytes = rs.getBytes(i);
267+
if(bytes == null) {
268+
value = CNull.NULL;
269+
} else {
270+
value = CByteArray.wrap(bytes, t);
271+
}
267272
break;
268273

269274
case Types.DATE:

0 commit comments

Comments
 (0)