UUserWidget* properties in custom Game Instance cause crash

The issue appears if there are any properties of UWidget* or UUserWidget* declared inside custom Game Instance C++ class in any form (directly, nested in ustructs, in arrays, maps etc.). When editing class defaults there is a standard option to select needed asset, but once pressed Compile the property gets cleared to none, once pressed Save, the editor crashes with stack overflow somewhere in UMG module.

I wasn’t sure it was a bug, thinking that game instance constructor is called too early for UMG. Now I’ve solved the it by declaring the pointer as UObject* - this way the problem gone, the cost was an additional getter method and a much larger asset list for the edited property, i.e. risk of a wrong choise, so the problem still exists as a concept.

UPD: The workaround is not actually working. Though the pointers are edited, saved and available in code (debug uncovers them as usual objects) they turn null when using Cast() or they cause crash when using standard C/C++ typecast and then calling widget methods. So I’m still not sure whether this is a bug or something by design.

Okay, the problem is generally in the difference between Widget Blueprint and UUserWidget, so using TSubclassOF makes the container editable, but forces to use expicitly CreateWidget somewhere else.

Still I don’t understand the mechanism. Previously I declared a bare UUserWidget* property in an APawn subclass, then assigned a widget in editor, then played in editor with no CreateWidget() and everything worked as if something is done under the hood in some classes and is not in the others.