Skip to content
Permalink
Browse files

Should fix NPE on connection [JENKINS-22478]

  • Loading branch information...
kutzi committed Apr 2, 2014
1 parent cedaa05 commit 50754eab3ebb96c426f513c14e6996ce927e1618
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/main/java/hudson/plugins/ircbot/v2/IRCConnection.java
@@ -110,7 +110,7 @@ public boolean connect() {
LOGGER.info(String.format("Connecting to %s:%s as %s using charset %s",
this.descriptor.getHost(), this.descriptor.getPort(), this.descriptor.getNick(), this.descriptor.getCharset()));

String password = Util.fixEmpty(this.descriptor.getPassword());
String socksHost = Util.fixEmpty(this.descriptor.getSocksHost());

final SocketFactory sf;
if (this.descriptor.isSsl()) {
@@ -119,12 +119,13 @@ public boolean connect() {
} else {
sf = SSLSocketFactory.getDefault();
}
} else if (!this.descriptor.getSocksHost().equals("") && this.descriptor.getSocksPort() > 0) {
} else if (socksHost != null && this.descriptor.getSocksPort() > 0) {
sf = new ProxySocketFactory(Proxy.Type.SOCKS, this.descriptor.getSocksHost(), this.descriptor.getSocksPort());
} else {
sf = SocketFactory.getDefault();
}

String password = Util.fixEmpty(this.descriptor.getPassword());
this.pircConnection.connect(this.descriptor.getHost(), this.descriptor.getPort(), password, sf);

LOGGER.info("connected to IRC");

0 comments on commit 50754ea

Please sign in to comment.
You can’t perform that action at this time.