message: Add a null checking for type resolving
  Summary: The code is trying to resolve a enum class name from a `$SwitchMap` field, it may get a null here.
diff: @@ -881,9 +881,13 @@ class OptimizeEnums {
  }
  }
  - if (type && is_enum(type_class(type))) {
  + if (type) {
  + if (auto possible_enum_cls = type_class(type)) {
  + if (is_enum(possible_enum_cls)) {
  return type;
  }
  + }
  + }
  std::size_t found = class_name.find_last_of('/');
  if (found == std::string::npos) {
  