Prevent invalid sitemap for params like yyyy=0

Use explicit checks against booleans should help us avoid serving up
duplicate sitemaps.

We also throw an error in the else condition, since there's no need to
show an empty sitemap index.