Do not parse JSON for access dropdown when it's undefined

We have quite a number of "undefined" is not valid JSON errors logged to Sentry. It goes in tens of thousands a month. Here are some examples:

The errors can be seen in the browser's console, when opening Project > Settings > Repository

Implementation guidelines

We do have a try/catch block for preselectedItems. That's where we're logging the error to Sentry.

I think we should add a check before that try/catch and not try to parse undefined. That will clear our logs a bit and leave only those errors that are a result of an unsuccessful parsing, such as this one (internal only).

Edited by Paulina Sedlak-Jakubowska