=== modified file 'src/main/java/org/mariadb/jdbc/MySQLPreparedStatement.java' --- old/src/main/java/org/mariadb/jdbc/MySQLPreparedStatement.java 2013-09-20 12:07:24 +0000 +++ new/src/main/java/org/mariadb/jdbc/MySQLPreparedStatement.java 2013-11-03 01:50:59 +0000 @@ -203,11 +203,17 @@ } public void clearBatch() { - batchPreparedStatements.clear(); + if (batchQueries != null) { + batchPreparedStatements.clear(); + } } @Override public int[] executeBatch() throws SQLException { + if (batchPreparedStatements == null) { + return new int[0]; + } + int[] ret = new int[batchPreparedStatements.size()]; int i = 0; try { === modified file 'src/main/java/org/mariadb/jdbc/MySQLStatement.java' --- old/src/main/java/org/mariadb/jdbc/MySQLStatement.java 2013-09-20 15:20:27 +0000 +++ new/src/main/java/org/mariadb/jdbc/MySQLStatement.java 2013-11-03 01:50:15 +0000 @@ -1085,7 +1085,9 @@ * @since 1.2 */ public void clearBatch() throws SQLException { - batchQueries.clear(); + if (batchQueries != null) { + batchQueries.clear(); + } } /**