Skip to content

Add safeguard for author in export setter

Subashis Chakraborty requested to merge 469446-fix-export into master

When attempting to export the Vulnerability report from the Security Center, it results in a 500 error. Because author is not present https://gitlab.com/gitlab-org/gitlab/-/blob/1b52b781879763b006004bd90c9bb527154cdd83/ee/app/models/vulnerabilities/export.rb#L107.

This MR introduces a safe navigation operator so that it does not throw any 500 error. This will not create any inconsistent data as we do not have any multiple organization right now and will set to 1.

I am working on a follow up MR to pass the author there, but this will prevent the production bug and user can download the vulnerabilities from export button until we have a proper fix.

Related to #469446 (closed)

Edited by Subashis Chakraborty

Merge request reports