Fix render fail on using search bar while analytics ID is not provided
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:
- Run the app in development mode without providing
GITLAB_ANALYTICS_ID
as an environment value and visit the main page. - Try to search a metric using the search bar - without this change the page fails to render.
Edited by Piotr Skorupa