File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -881,7 +881,7 @@ func MergePullRequest(ctx *context.APIContext) {
881881
882882 if form .DeleteBranchAfterMerge {
883883 var headRepo * git.Repository
884- if pr . HeadRepoID == pr .BaseRepoID {
884+ if ctx . Repo != nil && ctx . Repo . Repository != nil && ctx . Repo . Repository . ID == pr .HeadRepoID && ctx . Repo . GitRepo != nil {
885885 headRepo = ctx .Repo .GitRepo
886886 } else {
887887 headRepo , err = git .OpenRepository (pr .HeadRepo .RepoPath ())
Original file line number Diff line number Diff line change @@ -968,7 +968,7 @@ func MergePullRequest(ctx *context.Context) {
968968
969969 if form .DeleteBranchAfterMerge {
970970 var headRepo * git.Repository
971- if pr .HeadRepoID == ctx .Repo .Repository .ID {
971+ if ctx . Repo != nil && ctx . Repo . Repository != nil && pr .HeadRepoID == ctx .Repo .Repository .ID && ctx . Repo . GitRepo != nil {
972972 headRepo = ctx .Repo .GitRepo
973973 } else {
974974 headRepo , err = git .OpenRepository (pr .HeadRepo .RepoPath ())
@@ -1189,7 +1189,7 @@ func CleanUpPullRequest(ctx *context.Context) {
11891189 var gitBaseRepo * git.Repository
11901190
11911191 // Assume that the base repo is the current context (almost certainly)
1192- if ctx .Repo != nil && ctx .Repo .Repository .ID == pr .BaseRepoID && ctx .Repo .GitRepo != nil {
1192+ if ctx .Repo != nil && ctx .Repo .Repository != nil && ctx . Repo . Repository .ID == pr .BaseRepoID && ctx .Repo .GitRepo != nil {
11931193 gitBaseRepo = ctx .Repo .GitRepo
11941194 } else {
11951195 // If not just open it
You can’t perform that action at this time.
0 commit comments