mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-02-07 12:49:12 +01:00
DroidFish: Avoid NPE if engine sends invalid moves in the PV.
This commit is contained in:
parent
0cfda3577c
commit
936925dcc4
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user