#33 NullPointerException in Session.disconnect

open
nobody
None
5
2007-04-16
2007-04-16
Anonymous
No

Session.disconnect throws a NullPointerException when it calls synchronized(connectThread) because connectThread is null. Another thread has initiated a Session.connect and that thread is hung waiting for the data in auth=ua.start(this, userinfo). The user gets tired of waiting and closes the application which sees that a session object exists and isConnected is true so it calls Session.disconnect which throws the NPE. I believe isConnected should not be true until the session is truly connected and/or that Session.disconnect should verify that connectThread is not null.

Discussion


Log in to post a comment.