avoid null ptr in get_class_name