Fix TypeError: no implicit conversion of nil into String for Changelog

What does this MR do and why?

Contributes to #568851 (closed)

Problem

The changelog generation API endpoint fails with a TypeError when attempting to match a nil value against a regular expression in the UntrustedRegexp#match method.

Solution

Add missing validation for empty version case.

References

TypeError: no implicit conversion of nil into S... (#568851 - closed)

Screenshots or screen recordings

Before After

How to set up and validate locally

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #568851 (closed)

Merge request reports

Loading