From 33d63a564e9a83e86b9760c5e5876aab29be9c62 Mon Sep 17 00:00:00 2001 From: maddalax Date: Mon, 23 Sep 2024 16:15:19 -0500 Subject: [PATCH] why is this happening on windows --- cli/htmgo/tasks/process/pid_unix.go | 3 +++ cli/htmgo/tasks/process/pid_windows.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/cli/htmgo/tasks/process/pid_unix.go b/cli/htmgo/tasks/process/pid_unix.go index d85321c..95ad994 100644 --- a/cli/htmgo/tasks/process/pid_unix.go +++ b/cli/htmgo/tasks/process/pid_unix.go @@ -10,6 +10,9 @@ import ( ) func KillProcess(process *os.Process) error { + if process == nil { + return nil + } return syscall.Kill(-process.Pid, syscall.SIGKILL) } diff --git a/cli/htmgo/tasks/process/pid_windows.go b/cli/htmgo/tasks/process/pid_windows.go index 4dcb74a..3a79bbe 100644 --- a/cli/htmgo/tasks/process/pid_windows.go +++ b/cli/htmgo/tasks/process/pid_windows.go @@ -7,6 +7,9 @@ import ( import "golang.org/x/sys/windows" func KillProcess(process *os.Process) error { + if process == nil { + return nil + } return process.Kill() }