Crash in UniversalObjectLocatorFragment in 5.4.2, only in windows build

I’ve got a fix, but it’s ugly and needs a source build of Unreal and some C++ skills.

If you are as desperate as I was here are the steps to follow.

  1. Create a custom delegate, do it the way you prefer
  2. Change these bindings to be bound to your delegate (only if not with editor)
Engine\Source\Runtime\UniversalObjectLocator\Private\UniversalObjectLocatorModule.cpp [27]
#if WITH_EDITOR
FDelayedAutoRegisterHelper(EDelayedRegisterRunPhase::ObjectSystemReady
#else
//Your delegate
#endif
Engine\Source\Runtime\Engine\Private\UnrealEngine.cpp [321]
#if WITH_EDITOR
FDelayedAutoRegisterHelper(EDelayedRegisterRunPhase::RequestFragmentTypes,
#else
//Your delegate
#endif
  1. In UniversalObjectLocatorFragment.cpp execute your delegate the first time the function bool FUniversalObjectLocatorFragment::Serialize(FArchive& Ar) is called. Personnally I have put a simple bool bHasRequestedFragmentTypesRegistering

It should look like

if (FragmentTypeID == NAME_None)
{
	Reset();
}
else
{
   // ==== CHANGE ====
   if(!bHasRequestedFragmentTypesRegistering)
   {
        // Broadcast your delegate
        bHasRequestedFragmentTypesRegistering  = true;
   }
   // ==== END CHANGE ====

   // Find the FragmentType
   const FFragmentType* SerializedFragmentType = FRegistry::Get().FindFragmentType(FragmentTypeID);

Compile, run and enjoy!

I hope Unreal comes with a better fix.