Skip to content

Commit 707e8c2

Browse files
author
Michael Figuiere
committed
Fix possible NPE
1 parent 45b8bff commit 707e8c2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

driver-core/src/main/java/com/datastax/driver/core/Connection.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import java.util.concurrent.*;
2222
import java.util.concurrent.atomic.AtomicInteger;
2323
import java.util.concurrent.atomic.AtomicReference;
24-
import javax.net.ssl.SSLContext;
2524
import javax.net.ssl.SSLEngine;
2625

2726
import com.google.common.util.concurrent.AbstractFuture;
@@ -34,7 +33,6 @@
3433
import org.jboss.netty.bootstrap.ClientBootstrap;
3534
import org.jboss.netty.channel.*;
3635
import org.jboss.netty.channel.group.ChannelGroup;
37-
import org.jboss.netty.channel.group.ChannelGroupFuture;
3836
import org.jboss.netty.channel.group.DefaultChannelGroup;
3937
import org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory;
4038
import org.jboss.netty.handler.ssl.SslHandler;
@@ -116,7 +114,9 @@ private Connection(String name, InetAddress address, Factory factory) throws Con
116114
}
117115

118116
private static String extractMessage(Throwable t) {
119-
String msg = t == null || t.getMessage() == null || t.getMessage().isEmpty()
117+
if (t == null)
118+
return "";
119+
String msg = t.getMessage() == null || t.getMessage().isEmpty()
120120
? t.toString()
121121
: t.getMessage();
122122
return " (" + msg + ")";

0 commit comments

Comments
 (0)