Skip to content

Commit e3a2b0f

Browse files
chore(cli): add guard to service signal to stop hang on startup error
1 parent 5bd2d84 commit e3a2b0f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cli/internal/simulation/service/service.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ var stopSignals = []os.Signal{
8282

8383
// Signal - sends a signal to the service process
8484
func (s *ServiceSimulation) Signal(sig os.Signal) {
85+
// Check if command was ever started
86+
if s.cmd == nil || s.cmd.Process == nil {
87+
return
88+
}
89+
8590
if slices.Contains(stopSignals, sig) {
8691
s.autoRestart = false
8792
s.updateStatus(Status_Stopping)

0 commit comments

Comments
 (0)