From 779b15d2c261f8bb1bb7c93a9418f31f12ac6e82 Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Fri, 10 Oct 2025 09:28:45 +0100 Subject: [PATCH] appview/pulls: handle deleted forks in branch status check Signed-off-by: oppiliappan --- appview/pulls/pulls.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/appview/pulls/pulls.go b/appview/pulls/pulls.go index bf0da184..083a45fd 100644 --- a/appview/pulls/pulls.go +++ b/appview/pulls/pulls.go @@ -334,6 +334,11 @@ func (s *Pulls) branchDeleteStatus(r *http.Request, f *reporesolver.ResolvedRepo return nil } + // deleted fork + if repo == nil { + return nil + } + // user can only delete branch if they are a collaborator in the repo that the branch belongs to perms := s.enforcer.GetPermissionsInRepo(user.Did, repo.Knot, repo.DidSlashRepo()) if !slices.Contains(perms, "repo:push") { -- 2.51.2