Check blogIds to prevent sql errors

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.