don't try to label if centroid is undefined

fixes #1180