Prevent empty public projects from throwing exceptions

GITLAB-1279 (GITLAB-1264)

Change-Id: Ifb5b4313bc91fae720f8ef5c36152c45e9d38934
Merge pull request #5142 from karlhungus/bugfix-handle-empty-public-projects

Prevent empty public projects from throwing exceptions