diff options
Diffstat (limited to 'modules/process/manager.go')
-rw-r--r-- | modules/process/manager.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/process/manager.go b/modules/process/manager.go index 68c33315d0..1f98ca7cfb 100644 --- a/modules/process/manager.go +++ b/modules/process/manager.go @@ -113,7 +113,8 @@ func Remove(pid int64) { func Kill(pid int64) error { for i, proc := range Processes { if proc.Pid == pid { - if proc.Cmd.Process != nil && proc.Cmd.ProcessState != nil && !proc.Cmd.ProcessState.Exited() { + if proc.Cmd != nil && proc.Cmd.Process != nil && + proc.Cmd.ProcessState != nil && !proc.Cmd.ProcessState.Exited() { if err := proc.Cmd.Process.Kill(); err != nil { return fmt.Errorf("fail to kill process(%d/%s): %v", proc.Pid, proc.Description, err) } |