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() {
|
public void disconnectClient() {
|
||||||
Lobby l = getLobby();
|
Lobby l = getLobby();
|
||||||
|
if (l != null) {
|
||||||
Game g = l.getGame();
|
Game g = l.getGame();
|
||||||
if (l != null && g != null) {
|
if(g != null)
|
||||||
l.getGame().getGameState().handleClientDisconnect(this);
|
l.getGame().getGameState().handleClientDisconnect(this);
|
||||||
}
|
}
|
||||||
socket = this.getSocket();
|
socket = this.getSocket();
|
||||||
|
|||||||
Reference in New Issue
Block a user