Check blogIds to prevent sql errors and broken sitemap.xml

Return from function if blog ids are not set. Otherwise an incorrect
sql statement will break the script and the closing </urlset> tag is
missing.