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