From 31c38b631a45eb5c765e149e879f310dc10355fa Mon Sep 17 00:00:00 2001 From: Matt Brown Date: Wed, 14 Feb 2024 10:30:03 -0500 Subject: [PATCH] Avoid crash --- src/ttype/type_comparator/atomic_type_comparator.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ttype/type_comparator/atomic_type_comparator.rs b/src/ttype/type_comparator/atomic_type_comparator.rs index a244f341..b36b322e 100644 --- a/src/ttype/type_comparator/atomic_type_comparator.rs +++ b/src/ttype/type_comparator/atomic_type_comparator.rs @@ -889,10 +889,10 @@ pub(crate) fn can_be_identical<'a>( type1_part, TAtomic::TEnum { .. } | TAtomic::TEnumLiteralCase { .. } ) { - let enum_info = codebase.classlike_infos.get(name).unwrap(); - - if let Some(enum_type) = &enum_info.enum_type { - type2_part = enum_type; + if let Some(enum_info) = codebase.classlike_infos.get(name) { + if let Some(enum_type) = &enum_info.enum_type { + type2_part = enum_type; + } } } }