Avoid decoding unrelated profiles
This commit is contained in:
@@ -114,13 +114,13 @@ func loadProfile(ctx context.Context, fsys fs.FS, root string, id string) (*doma
|
||||
}
|
||||
continue
|
||||
}
|
||||
if !idMatch {
|
||||
continue
|
||||
}
|
||||
|
||||
prof, err := decodeProfile(data)
|
||||
if err != nil {
|
||||
if idMatch {
|
||||
return nil, fmt.Errorf("%w: %s: %v", ErrInvalidYAML, relPath, err)
|
||||
}
|
||||
continue
|
||||
return nil, fmt.Errorf("%w: %s: %v", ErrInvalidYAML, relPath, err)
|
||||
}
|
||||
|
||||
prof.ID = strings.TrimSpace(prof.ID)
|
||||
|
||||
Reference in New Issue
Block a user