zD12 / pircbotx

Automatically exported from code.google.com/p/pircbotx
0 stars 0 forks source link

Connection Refused exception causes NPE #139

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Attempt to non-existant or non-responsive server. eg irc.madeuphost.com: 6697

What is the expected output? What do you see instead?
a ConnectionException or IoException should be thrown, Instead a NPE is thrown
java.lang.NullPointerException
    at org.pircbotx.PircBotX.shutdown(PircBotX.java:2853)
    at org.pircbotx.PircBotX.connect(PircBotX.java:452)
    at org.pircbotx.PircBotX.connect(PircBotX.java:264)

What version of the product are you using? On what operating system?
1.9

Please provide any additional information below.
Need to add a null check eg
//Close the socket from here and let the threads die
        if (socket != null && !socket.isClosed())
            try {
                socket.shutdownInput();
                socket.close();
            } catch (Exception e) {
                logException(e);
            }

Original issue reported on code.google.com by Fergus.N...@googlemail.com on 19 Aug 2013 at 3:56

GoogleCodeExporter commented 9 years ago
In 2.0 the shutdown code was significantly improved which fixed this issue.

Log is attached. 

Original comment by Lord.Qua...@gmail.com on 1 Sep 2013 at 7:29

Attachments:

GoogleCodeExporter commented 9 years ago
Has 2.0 been released? If not then what is the schedule?

Original comment by Fergus.N...@googlemail.com on 1 Sep 2013 at 8:25

GoogleCodeExporter commented 9 years ago
I do not have an exact schedule for a final release, but you can download the 
SNAPSHOT version at http://code.google.com/p/pircbotx/wiki/DevVersion

Original comment by Lord.Qua...@gmail.com on 1 Sep 2013 at 11:57