Handle null image in MySQL
This commit is contained in:
parent
c026fc44b5
commit
64cdf8a32f
1 changed files with 5 additions and 1 deletions
|
|
@ -137,7 +137,11 @@ public class MySQLMapStorage extends MapStorage {
|
||||||
rslt.format = MapType.ImageEncoding.fromOrd(rs.getInt("Format"));
|
rslt.format = MapType.ImageEncoding.fromOrd(rs.getInt("Format"));
|
||||||
byte[] img = rs.getBytes("NewImage");
|
byte[] img = rs.getBytes("NewImage");
|
||||||
if (img == null) img = rs.getBytes("Image");
|
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();
|
rs.close();
|
||||||
stmt.close();
|
stmt.close();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue