Avoided null pointer exception by adding an if statement
This commit is contained in:
parent
b37916134a
commit
2f79b41618
@ -461,8 +461,9 @@ public class ClientHandler implements Runnable {
|
||||
*/
|
||||
public void disconnectClient() {
|
||||
Lobby l = getLobby();
|
||||
if (l != null) {
|
||||
Game g = l.getGame();
|
||||
if (l != null && g != null) {
|
||||
if(g != null)
|
||||
l.getGame().getGameState().handleClientDisconnect(this);
|
||||
}
|
||||
socket = this.getSocket();
|
||||
|
||||
Reference in New Issue
Block a user