fix rare nil ptr panic

master
Jaime Pillora 2016-09-14 23:04:36 +10:00
parent be5b0b50d8
commit cfea0d4997
1 changed files with 5 additions and 3 deletions

View File

@ -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)
}
}
}