From eab9795bccca890670882c394b1225b5d50aae9a Mon Sep 17 00:00:00 2001 From: Benson Wong Date: Fri, 7 Feb 2025 14:00:32 -0800 Subject: [PATCH] remove panic() when cmd or process is nil --- proxy/process.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proxy/process.go b/proxy/process.go index 65354da..bb731da 100644 --- a/proxy/process.go +++ b/proxy/process.go @@ -296,7 +296,8 @@ func (p *Process) stopCommand(sigtermTTL time.Duration) { }() if p.cmd == nil || p.cmd.Process == nil { - panic("this should not happen, cmd or cmd.Process is nil") + fmt.Fprintf(p.logMonitor, "!!! process [%s] cmd or cmd.Process is nil", p.ID) + return } p.cmd.Process.Signal(syscall.SIGTERM)