mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-04-22 03:52:50 +02:00
DroidFish: Added safety check to avoid null pointer exception in reportPromotePiece.
This commit is contained in:
parent
6194043af9
commit
68ecd0c854
@ -562,8 +562,10 @@ public class DroidChessController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Move promoteMove;
|
private Move promoteMove;
|
||||||
public final void reportPromotePiece(int choice) {
|
public final void reportPromotePiece(int choice) {
|
||||||
|
if (promoteMove == null)
|
||||||
|
return;
|
||||||
final boolean white = game.currPos().whiteMove;
|
final boolean white = game.currPos().whiteMove;
|
||||||
int promoteTo;
|
int promoteTo;
|
||||||
switch (choice) {
|
switch (choice) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user