Skip to content

Commit 0ef2985

Browse files
committed
Fix segfault on missing nextCommand
1 parent 8b4d46c commit 0ef2985

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/app/engine/process_continue_next_action.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,10 @@ func (e *Engine) ballPlacementTeam() state.Team {
304304
}
305305

306306
// no team failed at ball placement yet, team of next command is preferred
307-
teamInFavor := *e.currentState.NextCommand.ForTeam
307+
teamInFavor := state.Team_UNKNOWN
308+
if e.currentState.NextCommand != nil {
309+
teamInFavor = *e.currentState.NextCommand.ForTeam
310+
}
308311
if teamInFavor.Unknown() {
309312
// select a team by 50% chance (for example for force start)
310313
teamInFavor = e.randomTeam()

0 commit comments

Comments
 (0)