Blueprint Map Type with C++ Enum Key and Default Values causes Crash

A problem occured when I wanted to use a map variable that had the same C++ Enum for key and value type, which had default values.
Everything worked until the project was closed and reopened.
While trying to reopen, Unreal Engine crashed.
I figured the problem out after reverting changes from newest revisions on my SVN repository.

So, I tried to reproduce the same crash in new project.
And I succeeded in doing so, although the crash didn’t happen when opening the project.
Instead it crashed when opening an asset (in this case, map level) which used a map variable with C++ enum for key, which had default values.

Steps to reproduce:

  1. Create New Project
  2. Create New C++ class
  3. In header file add new enum class (
    UENUM(BlueprintType) enum class ETestEnum : uint8 { A, B, C};
    )
  4. Rebuild Project
  5. Create New Map Level
  6. Open New Map Level Blueprint
  7. Create new map variable which has the c++ enum class (
    ETestEnum
    ) for key
  8. Add at least 1 item to default values (this seems to be the crash causer)
  9. Close The Project
  10. Reopen The Project
  11. Try Opening the created Map
  12. Crash

For now, I use the workaround with enum switch, but as I add more enums, the switch will get bigger. :smiley:

Hi ,

I think this issue was corrected in 4.16, based on what I read in release notes. Also, I found a reported issue UE-42441, which looks like it’s fixed.

I haven’t tried to reproduce it yet (will do in a day or two), but if you say you can’t reproduce it, I guess that it’s definitely not a problem anymore. :slight_smile:

Milan

Hi MilanRadeta,

Thank you for letting us know about this issue. I was able to reproduce the crash that you described in 4.15.3, but was unable to reproduce it in 4.16.1. I believe this has been corrected. Could you confirm that you are no longer seeing it in 4.16?