Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null pointer exception when playing with AI #4

Open
Longwater1234 opened this issue Feb 22, 2024 · 0 comments
Open

Null pointer exception when playing with AI #4

Longwater1234 opened this issue Feb 22, 2024 · 0 comments

Comments

@Longwater1234
Copy link
Contributor

@Mchristos When playing against AI, after the AI did a double jump, i got NPE in the console as follows. it seems it is coming from line 192 of BoardState. I had not modified the original code.

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: Cannot invoke "org.davistiba.game.Piece.getPlayer()" because the return value of "org.davistiba.game.BoardState.getPiece(int)" is null
	at org.davistiba.game.BoardState.getSuccessors(BoardState.java:192)
	at org.davistiba.game.BoardState.getSuccessors(BoardState.java:170)
	at org.davistiba.game.Game.getValidMoves(Game.java:79)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant