Fix bug that happened when there was no category associated to an issue

Fixes #30642