Skip to content

Commit

Permalink
Try to avoid panic
Browse files Browse the repository at this point in the history
  • Loading branch information
MDrakos committed Sep 6, 2023
1 parent 496c21f commit 6721e1c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/runners/push/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,11 @@ func (r *Push) Run(params PushParams) error {

// Update the project at the given commit id.
bp := model.NewBuildPlannerModel(r.auth)
err = bp.AttachStagedCommit(targetNamespace.Owner, targetNamespace.Project, branch.CommitID.String(), commitID.String(), branch.Label)
var branchCommitID string
if branch.CommitID != nil {
branchCommitID = branch.CommitID.String()
}
err = bp.AttachStagedCommit(targetNamespace.Owner, targetNamespace.Project, branchCommitID, commitID.String(), branch.Label)
if err != nil {
return locale.WrapError(err, "err_push_attach_staged_commit", "Failed to attach staged commit to project.")
}
Expand Down

0 comments on commit 6721e1c

Please sign in to comment.