Skip to content

Commit 35b8bde

Browse files
committed
Fix: UHT - Fix to possible crash when generating enums
1 parent 48c4c45 commit 35b8bde

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

UE4SS/src/SDKGenerator/UEHeaderGenerator.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -2970,10 +2970,12 @@ namespace RC::UEGenerator
29702970
if (cpp_form == UEnum::ECppForm::EnumClass)
29712971
{
29722972
const auto underlying_type = m_underlying_enum_types.find(enum_native_name);
2973-
if (underlying_type->second == STR("uint8") ||
2974-
(underlying_type == m_underlying_enum_types.end() && (get_highest_enum(uenum) <= 255 && get_lowest_enum(uenum) >= 0)))
2973+
if ((underlying_type != m_underlying_enum_types.end() &&
2974+
underlying_type->second == STR("uint8")) ||
2975+
(underlying_type == m_underlying_enum_types.end() &&
2976+
get_highest_enum(uenum) <= 255 &&
2977+
get_lowest_enum(uenum) >= 0))
29752978
{
2976-
// Underlying type is implicit or explicitly uint8.
29772979
flag_format_helper.add_switch(STR("BlueprintType"));
29782980
}
29792981
}

0 commit comments

Comments
 (0)