Fix vulnerability attributes access when nil
What does this MR do and why?
Relates to #399117 (closed) and !123965 (merged)
Fixes https://sentry.gitlab.net/gitlab/gitlabcom/issues/4169293/?query=is:unresolved
The MR !123965 (merged) has been reverted with !126835 (merged), but we should include this fix when reintroducing the feature.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Martin Čavoj