LeftistTachyon / SimpleChess

My latest chess project! The next iteration up from OfflineChess.
MIT License
2 stars 0 forks source link

NullPointerException: offlinechess.ChessBoard.maybeMove (line 404) #1

Closed LeftistTachyon closed 6 years ago

LeftistTachyon commented 6 years ago

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.

LeftistTachyon commented 6 years ago

Moving any other null square to others works That's weird

LeftistTachyon commented 6 years ago

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

LeftistTachyon commented 6 years ago

Fixed!