Skip to content

Commit

Permalink
Merge branch 'refactor-messaging-models' of github.com:bacalhau-proje…
Browse files Browse the repository at this point in the history
…ct/bacalhau into refactor-messaging-models
  • Loading branch information
wdbaruni committed Oct 31, 2024
2 parents b343e8d + 4116d38 commit 8843862
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions pkg/models/messages/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@ type ExecutionMetadata struct {
}

func NewExecutionMetadata(execution *models.Execution) ExecutionMetadata {
return ExecutionMetadata{
ExecutionID: execution.ID,
JobID: execution.Job.ID,
}
if execution == nil {
return ExecutionMetadata{}
}
if execution.Job == nil {
return ExecutionMetadata{ExecutionID: execution.ID}
}
return ExecutionMetadata{
ExecutionID: execution.ID,
JobID: execution.Job.ID,
}
}

0 comments on commit 8843862

Please sign in to comment.