Fix 500 error for CompareController
What does this MR do and why?
Sentry error: https://sentry.gitlab.net/gitlab/gitlabcom/issues/3321361
Problem
User can provide empty string as a parameter. This value causes a 500 error when we try generate the link.
Solution
Convert empty strings to nil values that correctly processed.
How to set up and validate locally
- Visit link http://127.0.0.1:3000/gitlab-org/gitlab-shell/-/compare?to=&from=
- Verify that the error is gone
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.