瀏覽代碼

Fix the protected branch panic issue (#3567)

tags/v1.5.0-dev
Wendell Sun 6 年之前
父節點
當前提交
d2d0aea8a1
共有 1 個檔案被更改,包括 4 行新增0 行删除
  1. 4
    0
      models/branches.go

+ 4
- 0
models/branches.go 查看文件

@@ -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,

Loading…
取消
儲存