UE-81457

Crash when placing a native UserWidget in a panel within another UserWidget

Crash when placing a native UserWidget in a panel within another UserWidget

The engine crashes when trying to initialize a native UserWidget within another widget. This happens because UUserWidget::GetSlotNames gets called before the widget tree is initialized, and we don't check validity of the widget tree before iterating through it to locate named slots. We should investigate whether it's sufficient to wrap this in a null check, or if initialization should be reordered so that the tree is valid by the time this is called.

Steps to Reproduce

Create a native UUserWidget in C++

Create a UserWidget blueprint with a Canvas Panel. In PreConstruct, create your native widget and add it to the panel