Avoid NPE on LettuceConnectionFactory destroy

This commit is contained in:
Jennifer Hickey
2013-04-16 20:14:49 -07:00
parent a41c433c97
commit c7555dddff

View File

@@ -115,7 +115,9 @@ public class LettuceConnectionFactory implements InitializingBean, DisposableBea
*/ */
public void resetConnection() { public void resetConnection() {
synchronized (this.connectionMonitor) { synchronized (this.connectionMonitor) {
connection.close(); if(this.connection != null) {
this.connection.close();
}
this.connection = null; this.connection = null;
} }
} }