Fix potential (but never encountered) NPE

pull/154/head
Brett Wooldridge 11 years ago
parent 3b7095b477
commit aea005d4ea

@ -473,7 +473,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
checkClosed();
try {
delegate.setCatalog(catalog);
isCatalogDirty = !catalog.equals(parentPool.catalog);
isCatalogDirty = (catalog != null && !catalog.equals(parentPool.catalog)) || (catalog == null && parentPool.catalog != null);
}
catch (SQLException e) {
throw checkException(e);

@ -474,7 +474,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
checkClosed();
try {
delegate.setCatalog(catalog);
isCatalogDirty = !catalog.equals(parentPool.catalog);
isCatalogDirty = (catalog != null && !catalog.equals(parentPool.catalog)) || (catalog == null && parentPool.catalog != null);
}
catch (SQLException e) {
throw checkException(e);

Loading…
Cancel
Save