DroidFish: Protect against null pointer exception in DroidEngineControl.

This commit is contained in:
Peter Osterlund
2011-12-11 03:11:01 +00:00
parent a1746f75dd
commit c5f3b7817c

View File

@@ -315,6 +315,8 @@ public class DroidEngineControl {
* Try to find a move to ponder from the transposition table.
*/
final Move getPonderMove(Position pos, Move m) {
if (m == null)
return null;
Move ret = null;
UndoInfo ui = new UndoInfo();
pos.makeMove(m, ui);
@@ -333,6 +335,8 @@ public class DroidEngineControl {
}
static final String moveToString(Move m) {
if (m == null)
return "0000";
String ret = TextIO.squareToString(m.from);
ret += TextIO.squareToString(m.to);
switch (m.promoteTo) {