Skip to content

Commit

Permalink
fix rare nil ptr panic
Browse files Browse the repository at this point in the history
  • Loading branch information
jpillora committed Sep 14, 2016
1 parent be5b0b5 commit cfea0d4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions proc_master.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,11 @@ func (mp *master) handleSignal(s os.Signal) {
}

func (mp *master) sendSignal(s os.Signal) {
if err := mp.slaveCmd.Process.Signal(s); err != nil {
mp.debugf("signal failed (%s), assuming slave process died unexpectedly", err)
os.Exit(1)
if mp.slaveCmd != nil && mp.slaveCmd.Process != nil {
if err := mp.slaveCmd.Process.Signal(s); err != nil {
mp.debugf("signal failed (%s), assuming slave process died unexpectedly", err)
os.Exit(1)
}
}
}

Expand Down

0 comments on commit cfea0d4

Please sign in to comment.