Fix stacktrace encountered in some repo
I'm not quite sure how, but we have a repo in pagure that has an empty
directory and that messes things up.
With this commit at least we're not breaking anymore, but we're returning
a 404 instead.
Hopefully we can do better in the future.