Merge pull request #49 from fluxcd/gitrepository-panic

This commit is contained in:
Hidde Beydals 2020-04-29 17:04:32 +02:00 committed by GitHub
commit f2bff9053d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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())
}
}