Use a default value for the parameter that will be parsed by JSON.parse
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you can request access to GitLab Duo.
What does this MR do and why?
This commit aims to prevent unnecessary error logging to the Sentry caused by JSON.parse when the given value is undefined. So I've used a default value for that value.
Closes: #490960 (closed)
Changelog: changed
Screenshots or screen recordings
| Before | After |
|---|---|
| before.mov | after.mov |
How to set up and validate locally
- Run
GitLab. - Navigare to
<project>->Settings->Repository - Open the developers console (or observe Sentry logs).
- The
JSON.parseerror caused byinitAccessDropdown()should not be present and logged to the Sentry.
Edited by 🤖 GitLab Bot 🤖