Skip to content

Commit f2bff90

Browse files
authored
Merge pull request #49 from fluxcd/gitrepository-panic
2 parents af77de1 + 2c0b175 commit f2bff90

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

controllers/gitrepository_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ func (r *GitRepositoryReconciler) sync(ctx context.Context, repository sourcev1.
321321

322322
if revision == "" {
323323
revision = fmt.Sprintf("%s/%s", branch, ref.Hash().String())
324-
if repository.Spec.Reference.Tag != "" {
324+
if repository.Spec.Reference != nil && repository.Spec.Reference.Tag != "" {
325325
revision = fmt.Sprintf("%s/%s", repository.Spec.Reference.Tag, ref.Hash().String())
326326
}
327327
}

0 commit comments

Comments
 (0)