Closed LeftistTachyon closed 6 years ago
Moving any other null square to others works That's weird
This is the board at the exception:
rnb kbnr
ppp pppp
`
___p
PPPPPPPP
RNBQKBNR`
So the queen's gone.
And white hasn't moved a piece
Fixed!
Exception in thread "Thread-1" java.lang.NullPointerException
at offlinechess.ChessBoard.maybeMove(ChessBoard.java:404)
at offlinechess.ChessBoard.maybeMove(ChessBoard.java:369)
at offlinechess.AbstractPiece.legalMoves(AbstractPiece.java:76)
at offlinechess.ChessBoard.recalculateMoves(ChessBoard.java:307)
at offlinechess.ChessBoard.movePiece(ChessBoard.java:353)
at offlinechess.ChessBoard.movePiece(ChessBoard.java:320)
at simplechessserver.ClientCommunication$Handler.run(ClientCommunication.java:184)
Notes: This is because it moved a null piece. Not sure why it throws it here and not at line 383.