Skip to content

Commit f765d39

Browse files
committed
add nil guard to IsSafeContent
1 parent 4dfc946 commit f765d39

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

pkg/lockdown/lockdown.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ type CacheStats struct {
134134
// - the repository is private;
135135
// - the content was created by the viewer.
136136
func (c *RepoAccessCache) IsSafeContent(ctx context.Context, username, owner, repo string) (bool, error) {
137+
if c == nil {
138+
return false, fmt.Errorf("nil repo access cache")
139+
}
140+
137141
if c.isTrustedBot(username) {
138142
return true, nil
139143
}

0 commit comments

Comments
 (0)