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

  1. Run GitLab.
  2. Navigare to <project> -> Settings -> Repository
  3. Open the developers console (or observe Sentry logs).
  4. The JSON.parse error caused by initAccessDropdown() should not be present and logged to the Sentry.
Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading