diff --git a/LICENSE b/LICENSE index c121954..54970d5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018 - 2021, Přemysl Eric Janouch +Copyright (c) 2018 - 2022, Přemysl Eric Janouch Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. diff --git a/hswg/main.go b/hswg/main.go index e4b557f..88ed486 100644 --- a/hswg/main.go +++ b/hswg/main.go @@ -49,6 +49,10 @@ func (m *Metadata) Attr(name string) string { // AttrList is similar to Attr, but splits the result at commas, // and trims whitespace around array elements. func (m *Metadata) AttrList(name string) []string { + if !m.Attributes.Has(name) { + return nil + } + res := strings.Split(m.Attr(name), ",") for i := range res { res[i] = strings.TrimSpace(res[i])