Skip to content

Commit

Permalink
Merge pull request #49 from fluxcd/gitrepository-panic
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddeco authored Apr 29, 2020
2 parents af77de1 + 2c0b175 commit f2bff90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/gitrepository_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ func (r *GitRepositoryReconciler) sync(ctx context.Context, repository sourcev1.

if revision == "" {
revision = fmt.Sprintf("%s/%s", branch, ref.Hash().String())
if repository.Spec.Reference.Tag != "" {
if repository.Spec.Reference != nil && repository.Spec.Reference.Tag != "" {
revision = fmt.Sprintf("%s/%s", repository.Spec.Reference.Tag, ref.Hash().String())
}
}
Expand Down

0 comments on commit f2bff90

Please sign in to comment.