~sircmpwn/builds.sr.ht

a22a255b19801c8d4316bc3fbfd62a3150b7c8ed — Drew DeVault a month ago 7325acd 0.58.16
worker: handle nil environment values
1 files changed, 4 insertions(+), 0 deletions(-)

M worker/tasks.go
M worker/tasks.go => worker/tasks.go +4 -0
@@ 179,6 179,10 @@ export JOB_ID=%d
	ctx.Manifest.Environment["JOB_URL"] = fmt.Sprintf(
		"%s/~%s/job/%d", origin, ctx.Job.Username, ctx.Job.Id)
	for key, value := range ctx.Manifest.Environment {
		if value == nil {
			env += fmt.Sprintf("export %s=\"\"\n", key)
			continue
		}
		switch v := value.(type) {
		case bool:
			if v {