fix: Check if OwnersDirExcludes is non-nil before using it
fixes
@@ -233,13 +233,16 @@ func (c *Client) LoadRepoOwners(org, repo, base string) (RepoOwner, error) {
excludeConfig := c.config.OwnersDirExcludes
- dirExcludes := defaultDirExcludes.Union(sets.NewString(excludeConfig.Default...))
+ dirExcludes := sets.NewString()
+ if excludeConfig != nil {
+ dirExcludes = defaultDirExcludes.Union(sets.NewString(excludeConfig.Default...))
if bl, ok := excludeConfig.Repos[org]; ok {
dirExcludes.Insert(bl...)
}
if bl, ok := excludeConfig.Repos[org+"/"+repo]; ok {
dirExcludes.Insert(bl...)
}
+ }
entry.owners, err = loadOwnersFrom(gitRepo.Dir, mdYaml, entry.aliases, dirExcludes, log)
if err != nil {
return nil, fmt.Errorf("failed to load RepoOwners for %s: %v", fullName, err)
