4.8 Crash when opening asset in editor + fix

Hello,

I get this crash when i try to open a blueprint asset in the content browser: http:///uP65P9L8 .

I dont know what is the reason for this … maybe because if moved these assets in content browser to another folder.
Anyway i tried to fix this crash by myself and it works for me:

diff --git a/Engine/Source/Editor/UnrealEd/Private/Kismet2/EnumEditorUtils.cpp b/Engine/Source/Editor/UnrealEd/Private/Kismet2/EnumEditorUtils.cpp
index ec616a9..aa78083 100644
--- a/Engine/Source/Editor/UnrealEd/Private/Kismet2/EnumEditorUtils.cpp
+++ b/Engine/Source/Editor/UnrealEd/Private/Kismet2/EnumEditorUtils.cpp
@@ -374,7 +374,7 @@ void FEnumEditorUtils::EnsureAllDisplayNamesExist(UUserDefinedEnum* Enum)
 {
 	if (Enum)
 	{
-		const int32 EnumeratorsToEnsure = Enum->NumEnums() - 1;
+		const int32 EnumeratorsToEnsure = Enum->NumEnums() > 0 ? Enum->NumEnums() - 1 : 0;
 		Enum->DisplayNames.Empty(EnumeratorsToEnsure);
 		for	(int32 Index = 0; Index < EnumeratorsToEnsure; Index++)
 		{

Hi Footman,

Thank you for reporting this crash and good job finding a fix!

As you have a working fix, I would suggest making a Pull Request on github (.com/EpicGames/UnrealEngine) to have this fix integrated into a future version of the engine. This will allow us to evaluate the change and is the usual way we take in code submissions from the community.

Have a nice day,