提交 ac39f083 authored 作者: Andrei Tokar's avatar Andrei Tokar

prevent failure of TestCrashAPI, when null is passed as byte[]

上级 90883fd3
...@@ -102,6 +102,9 @@ public class JdbcBlob extends JdbcLob implements Blob { ...@@ -102,6 +102,9 @@ public class JdbcBlob extends JdbcLob implements Blob {
*/ */
@Override @Override
public int setBytes(long pos, byte[] bytes) throws SQLException { public int setBytes(long pos, byte[] bytes) throws SQLException {
if (bytes == null) {
return 0;
}
try { try {
if (isDebugEnabled()) { if (isDebugEnabled()) {
debugCode("setBytes("+pos+", "+quoteBytes(bytes)+");"); debugCode("setBytes("+pos+", "+quoteBytes(bytes)+");");
...@@ -129,6 +132,9 @@ public class JdbcBlob extends JdbcLob implements Blob { ...@@ -129,6 +132,9 @@ public class JdbcBlob extends JdbcLob implements Blob {
@Override @Override
public int setBytes(long pos, byte[] bytes, int offset, int len) public int setBytes(long pos, byte[] bytes, int offset, int len)
throws SQLException { throws SQLException {
if (bytes == null) {
return 0;
}
try { try {
if (isDebugEnabled()) { if (isDebugEnabled()) {
debugCode("setBytes(" + pos + ", " + quoteBytes(bytes) + ", " + offset + ", " + len + ");"); debugCode("setBytes(" + pos + ", " + quoteBytes(bytes) + ", " + offset + ", " + len + ");");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论