diff options
Diffstat (limited to 'internal/cvss/v3key.go')
-rw-r--r-- | internal/cvss/v3key.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/internal/cvss/v3key.go b/internal/cvss/v3key.go index f1f32cd..653c2da 100644 --- a/internal/cvss/v3key.go +++ b/internal/cvss/v3key.go @@ -99,10 +99,18 @@ var v3Keys = map[v3Key]struct { // Get metric key name. func (k v3Key) Name() string { - return v3Keys[k].Name + if data, ok := v3Keys[k]; ok { + return data.Name + } else { + return "invalid" + } } // Get metric key category. func (k v3Key) Category() Category { - return v3Keys[k].Category + if data, ok := v3Keys[k]; ok { + return data.Category + } else { + return InvalidCategory + } } |