Parcourir la source

Fix the protected branch panic issue (#3567)

tags/v1.5.0-dev
Wendell Sun il y a 6 ans
Parent
révision
d2d0aea8a1
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 4
    0
      models/branches.go

+ 4
- 0
models/branches.go Voir le fichier

@@ -155,6 +155,10 @@ func (repo *Repository) GetProtectedBranches() ([]*ProtectedBranch, error) {

// IsProtectedBranch checks if branch is protected
func (repo *Repository) IsProtectedBranch(branchName string, doer *User) (bool, error) {
if doer == nil {
return true, nil
}

protectedBranch := &ProtectedBranch{
RepoID: repo.ID,
BranchName: branchName,

Chargement…
Annuler
Enregistrer