mirror of
https://github.com/go-gitea/gitea
synced 2024-12-23 00:54:28 +00:00
Fix the nil pointer when assigning issues to projects (#25665)
Fixes #25649 Caused by #25468
This commit is contained in:
parent
0006169f38
commit
ff140d4050
@ -436,10 +436,12 @@ func UpdateIssueProject(ctx *context.Context) {
|
|||||||
|
|
||||||
projectID := ctx.FormInt64("id")
|
projectID := ctx.FormInt64("id")
|
||||||
for _, issue := range issues {
|
for _, issue := range issues {
|
||||||
|
if issue.Project != nil {
|
||||||
oldProjectID := issue.Project.ID
|
oldProjectID := issue.Project.ID
|
||||||
if oldProjectID == projectID {
|
if oldProjectID == projectID {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if err := issues_model.ChangeProjectAssign(issue, ctx.Doer, projectID); err != nil {
|
if err := issues_model.ChangeProjectAssign(issue, ctx.Doer, projectID); err != nil {
|
||||||
ctx.ServerError("ChangeProjectAssign", err)
|
ctx.ServerError("ChangeProjectAssign", err)
|
||||||
|
@ -385,10 +385,12 @@ func UpdateIssueProject(ctx *context.Context) {
|
|||||||
|
|
||||||
projectID := ctx.FormInt64("id")
|
projectID := ctx.FormInt64("id")
|
||||||
for _, issue := range issues {
|
for _, issue := range issues {
|
||||||
|
if issue.Project != nil {
|
||||||
oldProjectID := issue.Project.ID
|
oldProjectID := issue.Project.ID
|
||||||
if oldProjectID == projectID {
|
if oldProjectID == projectID {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if err := issues_model.ChangeProjectAssign(issue, ctx.Doer, projectID); err != nil {
|
if err := issues_model.ChangeProjectAssign(issue, ctx.Doer, projectID); err != nil {
|
||||||
ctx.ServerError("ChangeProjectAssign", err)
|
ctx.ServerError("ChangeProjectAssign", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user