mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix null bug
This commit is contained in:
@@ -152,10 +152,12 @@ public final class DbUtil {
|
||||
*/
|
||||
public static void close(Object... objsToClose) {
|
||||
for (Object obj : objsToClose) {
|
||||
if (obj instanceof AutoCloseable) {
|
||||
IoUtil.close((AutoCloseable) obj);
|
||||
} else {
|
||||
log.warn("Object {} not a ResultSet or Statement or PreparedStatement or Connection!", obj.getClass().getName());
|
||||
if(null != obj){
|
||||
if (obj instanceof AutoCloseable) {
|
||||
IoUtil.close((AutoCloseable) obj);
|
||||
} else {
|
||||
log.warn("Object {} not a ResultSet or Statement or PreparedStatement or Connection!", obj.getClass().getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user