Skip to content

Commit

Permalink
Only set host and port if we pass a non-null value
Browse files Browse the repository at this point in the history
  • Loading branch information
Mina Asham committed Mar 25, 2021
1 parent f933ea3 commit c939b78
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ public DefaultJedisSocketFactory(String host, int port, int connectionTimeout, i
}

public DefaultJedisSocketFactory(HostAndPort hostAndPort, JedisClientConfig config) {
this.hostAndPort.set(hostAndPort);
if (hostAndPort != null) {
this.hostAndPort.set(hostAndPort);
}
if (config != null) {
this.connectionTimeout = config.getConnectionTimeoutMillis();
this.socketTimeout = config.getSocketTimeoutMillis();
Expand Down

0 comments on commit c939b78

Please sign in to comment.