Skip to content

Commit 4fc8a08

Browse files
prevent user from attempting search without first specifying a position
1 parent d747284 commit 4fc8a08

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

uci.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,13 @@ func (uci *UCIAdapter) Read(reader *bufio.Reader) {
203203
// There are a number of commands that can follow this command, all will be sent in the same string.
204204
// If one command is not send its value should be interpreted as it would not influence the search.
205205
case "go":
206-
ponder = uci.start(uciFields[1:]) // parse any parameters given by GUI and begin searching.
207-
if !uci.optionPonder || !ponder {
208-
uci.moveCounter++
206+
if uci.brd != nil {
207+
ponder = uci.start(uciFields[1:]) // parse any parameters given by GUI and begin searching.
208+
if !uci.optionPonder || !ponder {
209+
uci.moveCounter++
210+
}
211+
} else {
212+
uci.InfoString("You must set the current position via the position command before searching.\n")
209213
}
210214
// * stop
211215
// stop calculating as soon as possible,

0 commit comments

Comments
 (0)