Skip to content

Commit

Permalink
add nullcheck to skip
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias committed Jan 26, 2021
1 parent 77dc2bb commit d56b50b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ func (tg *Manager) GetQuestion() {

func (tg *Manager) Skip() {
tg.mutex.Lock()
tg.Send(fmt.Sprintf("[Skipped] Answer: %s ", tg.currentGame.Question.answer), nil)
if tg.currentGame != nil {
tg.Send(fmt.Sprintf("[Skipped] Answer: %s ", tg.currentGame.Question.answer), nil)
}
tg.mutex.Unlock()
tg.NewGame()
}
Expand Down

0 comments on commit d56b50b

Please sign in to comment.