Browse Source

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

Fixes #25649
Caused by #25468
tags/v1.21.0-rc0
Zettat123 11 months ago
parent
commit
ff140d4050
No account linked to committer's email address
2 changed files with 10 additions and 6 deletions
  1. 5
    3
      routers/web/org/projects.go
  2. 5
    3
      routers/web/repo/projects.go

+ 5
- 3
routers/web/org/projects.go View File

@@ -436,9 +436,11 @@ func UpdateIssueProject(ctx *context.Context) {

projectID := ctx.FormInt64("id")
for _, issue := range issues {
oldProjectID := issue.Project.ID
if oldProjectID == projectID {
continue
if issue.Project != nil {
oldProjectID := issue.Project.ID
if oldProjectID == projectID {
continue
}
}

if err := issues_model.ChangeProjectAssign(issue, ctx.Doer, projectID); err != nil {

+ 5
- 3
routers/web/repo/projects.go View File

@@ -385,9 +385,11 @@ func UpdateIssueProject(ctx *context.Context) {

projectID := ctx.FormInt64("id")
for _, issue := range issues {
oldProjectID := issue.Project.ID
if oldProjectID == projectID {
continue
if issue.Project != nil {
oldProjectID := issue.Project.ID
if oldProjectID == projectID {
continue
}
}

if err := issues_model.ChangeProjectAssign(issue, ctx.Doer, projectID); err != nil {

Loading…
Cancel
Save