1
0
mirror of https://github.com/go-gitea/gitea synced 2024-11-07 09:15:53 +01:00

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

Fixes #25649
Caused by #25468
This commit is contained in:
Zettat123 2023-07-04 18:26:24 +08:00 committed by GitHub
parent 0006169f38
commit ff140d4050
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

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

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