Fix the nil pointer when assigning issues to projects (#25665)

Fixes #25649
Caused by #25468
pull/25662/head^2
Zettat123 2 years ago committed by GitHub
parent 0006169f38
commit ff140d4050
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      routers/web/org/projects.go
  2. 2
      routers/web/repo/projects.go

@ -436,10 +436,12 @@ func UpdateIssueProject(ctx *context.Context) {
projectID := ctx.FormInt64("id")
for _, issue := range issues {
if issue.Project != nil {
oldProjectID := issue.Project.ID
if oldProjectID == projectID {
continue
}
}
if err := issues_model.ChangeProjectAssign(issue, ctx.Doer, projectID); err != nil {
ctx.ServerError("ChangeProjectAssign", err)

@ -385,10 +385,12 @@ func UpdateIssueProject(ctx *context.Context) {
projectID := ctx.FormInt64("id")
for _, issue := range issues {
if issue.Project != nil {
oldProjectID := issue.Project.ID
if oldProjectID == projectID {
continue
}
}
if err := issues_model.ChangeProjectAssign(issue, ctx.Doer, projectID); err != nil {
ctx.ServerError("ChangeProjectAssign", err)

Loading…
Cancel
Save