Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/concerns/enums/sbom.rb')
-rw-r--r--app/models/concerns/enums/sbom.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/concerns/enums/sbom.rb b/app/models/concerns/enums/sbom.rb
index 3ba911dbcc5..59aafc32d94 100644
--- a/app/models/concerns/enums/sbom.rb
+++ b/app/models/concerns/enums/sbom.rb
@@ -26,7 +26,9 @@ module Enums
end
def self.purl_types
- PURL_TYPES
+ # return 0 by default if the purl_type is not found, to prevent
+ # consumers from producing invalid SQL caused by null entries
+ @_purl_types ||= PURL_TYPES.dup.tap { |h| h.default = 0 }
end
end
end