mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-12-21 13:12:17 +01:00
DroidFish: Avoid NPE if engine sends invalid moves in the PV.
This commit is contained in:
@@ -455,7 +455,7 @@ public class ChessBoard extends View {
|
||||
int n = Math.min(moveMarkPaint.size(), moveHints.size());
|
||||
for (int i = 0; i < n; i++) {
|
||||
Move m = moveHints.get(i);
|
||||
if (m.from == m.to)
|
||||
if ((m == null) || (m.from == m.to))
|
||||
continue;
|
||||
float x0 = getXCrd(Position.getX(m.from)) + h;
|
||||
float y0 = getYCrd(Position.getY(m.from)) + h;
|
||||
|
||||
Reference in New Issue
Block a user