1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Fix nil pointer dereference error when open link with invalid pull index (#26353)

fix #26331 

Before:

![image](https://github.com/go-gitea/gitea/assets/50507092/028e6944-84d1-4404-80b6-4a4accdc7d0a)

After:

![image](https://github.com/go-gitea/gitea/assets/50507092/b78978f9-e77f-459f-96e1-3a1f36ec8abe)
This commit is contained in:
CaiCandong
2023-08-07 11:43:18 +08:00
committed by GitHub
parent 049e400327
commit 24fbf4e059
2 changed files with 30 additions and 29 deletions

View File

@@ -259,8 +259,8 @@ type viewedFilesUpdate struct {
func UpdateViewedFiles(ctx *context.Context) {
// Find corresponding PR
issue := checkPullInfo(ctx)
if ctx.Written() {
issue, ok := getPullInfo(ctx)
if !ok {
return
}
pull := issue.PullRequest