Add null check for timer and assign to variable so it is shutdown..

pull/673/head
Johno Crawford 8 years ago
parent c0f9177b87
commit 6f1ee85e0b
No known key found for this signature in database
GPG Key ID: F1CCEA385ED76FCC

@ -97,7 +97,11 @@ public class RedisClient {
public RedisClient(final Timer timer, ExecutorService executor, EventLoopGroup group, Class<? extends SocketChannel> socketChannelClass, String host, int port, public RedisClient(final Timer timer, ExecutorService executor, EventLoopGroup group, Class<? extends SocketChannel> socketChannelClass, String host, int port,
int connectTimeout, int commandTimeout) { int connectTimeout, int commandTimeout) {
if (timer == null) {
throw new NullPointerException("timer param can't be null");
}
this.executor = executor; this.executor = executor;
this.timer = timer;
addr = new InetSocketAddress(host, port); addr = new InetSocketAddress(host, port);
bootstrap = new Bootstrap().channel(socketChannelClass).group(group).remoteAddress(addr); bootstrap = new Bootstrap().channel(socketChannelClass).group(group).remoteAddress(addr);
bootstrap.handler(new ChannelInitializer<Channel>() { bootstrap.handler(new ChannelInitializer<Channel>() {

Loading…
Cancel
Save