Skip to content

Commit

Permalink
Only range over the channels if it is not nil
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Jun 6, 2013
1 parent a69167d commit 7f922c9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions basic_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ func (b *BasicRunner) Run(state map[string]interface{}) {
b.l.Lock()
defer b.l.Unlock()

for _, doneCh := range b.cancelChs {
doneCh <- true
if b.cancelChs != nil {
for _, doneCh := range b.cancelChs {
doneCh <- true
}
}

b.running = false
Expand Down

0 comments on commit 7f922c9

Please sign in to comment.