1
0
Fork 0
forked from forgejo/forgejo

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

fix #26331 

Before:

![image](028e6944-84d1-4404-80b6-4a4accdc7d0a)

After:

![image](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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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