mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-12-12 17:12:40 +01:00
DroidFish: Added safety check to avoid null pointer exception in reportPromotePiece.
This commit is contained in:
@@ -562,8 +562,10 @@ public class DroidChessController {
|
||||
}
|
||||
}
|
||||
|
||||
Move promoteMove;
|
||||
private Move promoteMove;
|
||||
public final void reportPromotePiece(int choice) {
|
||||
if (promoteMove == null)
|
||||
return;
|
||||
final boolean white = game.currPos().whiteMove;
|
||||
int promoteTo;
|
||||
switch (choice) {
|
||||
|
||||
Reference in New Issue
Block a user