fix: guard against whitespace-only type attribute panic in ParseReleaseGroups

This commit is contained in:
2026-07-19 21:08:57 +03:00
parent 2468859435
commit ab2af62cb0

View File

@@ -148,7 +148,9 @@ func ParseReleaseGroups(data []byte) (*ParsedReleaseGroups, error) {
// so take the first token as the primary type. // so take the first token as the primary type.
primary := rg.PrimaryType primary := rg.PrimaryType
if primary == "" && rg.TypeAttr != "" { if primary == "" && rg.TypeAttr != "" {
primary = strings.Fields(rg.TypeAttr)[0] if fields := strings.Fields(rg.TypeAttr); len(fields) > 0 {
primary = fields[0]
}
} }
result.ReleaseGroups = append(result.ReleaseGroups, ReleaseGroup{ result.ReleaseGroups = append(result.ReleaseGroups, ReleaseGroup{
ID: rg.ID, ID: rg.ID,