Check if an entity was found before trying to use it.