mirror of
https://github.com/Hopiu/micro.git
synced 2026-03-16 22:10:26 +00:00
avoid creating nil callback for JobSpawn (#3554)
This commit is contained in:
parent
56c1f75bad
commit
831e31d483
1 changed files with 4 additions and 2 deletions
|
|
@ -78,8 +78,10 @@ func JobSpawn(cmdName string, cmdArgs []string, onStdout, onStderr, onExit func(
|
|||
go func() {
|
||||
// Run the process in the background and create the onExit callback
|
||||
proc.Run()
|
||||
jobFunc := JobFunction{onExit, outbuf.String(), userargs}
|
||||
Jobs <- jobFunc
|
||||
if onExit != nil {
|
||||
jobFunc := JobFunction{onExit, outbuf.String(), userargs}
|
||||
Jobs <- jobFunc
|
||||
}
|
||||
}()
|
||||
|
||||
return &Job{proc, stdin}
|
||||
|
|
|
|||
Loading…
Reference in a new issue