Yes, you are right.
What about replacing the 'return sites' by
    if not se_site_map:
        return []
but outside the if. This will return an empty list if the map has never been built.