Handle null image in MySQL

This commit is contained in:
Mike Primm 2022-07-30 18:49:55 -05:00
parent 082878aade
commit dc66d12916
1 changed files with 5 additions and 1 deletions

View File

@ -137,7 +137,11 @@ public class MySQLMapStorage extends MapStorage {
rslt.format = MapType.ImageEncoding.fromOrd(rs.getInt("Format"));
byte[] img = rs.getBytes("NewImage");
if (img == null) img = rs.getBytes("Image");
rslt.image = new BufferInputStream(img);
if (img == null) {
rslt = null;
} else {
rslt.image = new BufferInputStream(img);
}
}
rs.close();
stmt.close();