aboutsummaryrefslogtreecommitdiff
path: root/internal/cvss/v2key.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/cvss/v2key.go')
-rw-r--r--internal/cvss/v2key.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/internal/cvss/v2key.go b/internal/cvss/v2key.go
index 26ee200..740d26d 100644
--- a/internal/cvss/v2key.go
+++ b/internal/cvss/v2key.go
@@ -75,10 +75,18 @@ var v2Keys = map[v2Key]struct {
// Get metric key name.
func (k v2Key) Name() string {
- return v2Keys[k].Name
+ if data, ok := v2Keys[k]; ok {
+ return data.Name
+ } else {
+ return "invalid"
+ }
}
// Get metric key category.
func (k v2Key) Category() Category {
- return v2Keys[k].Category
+ if data, ok := v2Keys[k]; ok {
+ return data.Category
+ } else {
+ return InvalidCategory
+ }
}