\Engine\Source\Runtime\CoreUObject\Private\Blueprint\BlueprintSupport.cpp
if (IsBlueprintFinalizationPending())
{
// have to prematurely set the CDO's linker so we can force a Preload()/
// Serialization of the CDO before we regenerate the Blueprint class
{
if (DeferredCDOIndex != INDEX_NONE)
{
const EObjectFlags OldFlags = BlueprintCDO->GetFlags(); <-- Access violation
BlueprintCDO->ClearFlags(RF_NeedLoad | RF_NeedPostLoad);
BlueprintCDO->SetLinker(this, DeferredCDOIndex, /*bShouldDetatchExisting =*/false);
BlueprintCDO->SetFlags(OldFlags);
}
}
Dump Call Stack : (Download)
The BlueprintCDO is nullptr.
How can I fix it?
AGameMode_InGame::AGameMode_InGame(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
if (!ItemDataLibrary)
{
ItemDataLibrary = UObjectLibrary::CreateLibrary(UObject::StaticClass(), false, false);
ItemDataLibrary->AddToRoot();
}
ItemDataLibrary->LoadAssetDataFromPath(TEXT("/Game/Items")); // -> changed to /Game/Items/Textures
const bool bFullyLoad = true;
if (bFullyLoad)
{
ItemDataLibrary->LoadAssetsFromAssetData();
}
}
“/Game/Items” folder contains some blueprint classes.
I solved the problem by changing the path(LoadAssetDataFromPath()).