Skip to content

Commit 50eed70

Browse files
zhangt2333harawata
andauthored
Update src/main/java/org/apache/ibatis/executor/ReuseExecutor.java
Co-Authored-By: Iwao AVE! <[email protected]>
1 parent 19f4c3e commit 50eed70

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/apache/ibatis/executor/ReuseExecutor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ private Statement prepareStatement(StatementHandler handler, Log statementLog) t
9595

9696
private boolean hasStatementFor(String sql) {
9797
try {
98-
return statementMap.containsKey(sql) && !statementMap.get(sql).getConnection().isClosed();
98+
Statement statement = statementMap.get(sql);
99+
return statement != null && !statement.getConnection().isClosed();
99100
} catch (SQLException e) {
100101
return false;
101102
}

0 commit comments

Comments
 (0)