1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

On tag/branch-exist check, dont panic if repo is nil (#21787)

fix a panic found in gitea logs
This commit is contained in:
6543
2022-12-04 11:28:57 +01:00
committed by GitHub
parent 36cbaec54c
commit 46485848fa
2 changed files with 2 additions and 2 deletions

View File

@@ -52,7 +52,7 @@ func (repo *Repository) IsReferenceExist(name string) bool {
// IsBranchExist returns true if given branch exists in current repository.
func (repo *Repository) IsBranchExist(name string) bool {
if name == "" {
if repo == nil || name == "" {
return false
}