Fix for #4535 ('Test settings' button for services gives 500 on empty repo)

This will fix the issue (#4535).