Skip to content

Fix render fail on using search bar while analytics ID is not provided

Piotr Skorupa requested to merge psk-add-optional-chaining-to-glclient into main

I've noticed the app breaks when using the search bar and it turned out that it only happens when GitLab analytics is not being used.

This fixes the app failing to render on using the search bar due to glClient being null if GITLAB_ANALYTICS_ID is not provided, by adding optional chaining.

Steps to reproduce:

  1. Run the app in development mode without providing GITLAB_ANALYTICS_ID as an environment value and visit the main page.
  2. Try to search a metric using the search bar - without this change the page fails to render.
Edited by Piotr Skorupa

Merge request reports