fix: resolve crash operator in some cases

This commit is contained in:
2025-01-17 21:11:17 +03:30
parent 322877ad8e
commit 896d45e15a
3 changed files with 18 additions and 8 deletions

View File

@@ -1,5 +1,11 @@
package managed_job
import "errors"
func (job *ManagedJob) Stop() error {
return job.client.StopJob(*job.def.Status.JobId)
if job.def.Status.JobId != nil {
return job.client.StopJob(*job.def.Status.JobId)
} else {
return errors.New("job Id not found")
}
}