Added checks before rendering content in location partial