worker: Check OSBuildOutput for nil before using it

It is possible for it to end up as nil so it needs to be checked
everywhere it is used.
This commit is contained in:
Brian C. Lane 2020-05-15 14:54:42 -07:00 committed by Tom Gundersen
parent 4958d15413
commit 4f3f09fec5

View file

@ -103,7 +103,7 @@ func (s *Server) JobStatus(id uuid.UUID) (*JobStatus, error) {
if canceled {
state = common.CFailed
} else if !finished.IsZero() {
if result.OSBuildOutput.Success {
if result.OSBuildOutput != nil && result.OSBuildOutput.Success {
state = common.CFinished
} else {
state = common.CFailed