Skip to content

Commit

Permalink
Fix issue #26: assertion failed at serializing asset registry when in…
Browse files Browse the repository at this point in the history
…cluding redirectors

(cherry picked from commit 9bcc6f2)
  • Loading branch information
stlnkm committed Jan 28, 2022
1 parent f67cd66 commit 70c5745
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1391,14 +1391,20 @@ bool UFlibHotPatcherCoreHelper::SerializeAssetRegistry(const FString& PlatformNa
AssetRegistry.InitializeTemporaryAssetRegistryState(State, SaveOptions, true);
for(const auto& AssetPackagePath:PackagePaths)
{
if(State.GetAssetByObjectPath(FName(*AssetPackagePath)))
if (State.GetAssetByObjectPath(FName(*AssetPackagePath)))
{
UE_LOG(LogHotPatcherCoreHelper,Warning,TEXT("%s Alway add to AssetRegistryState!"),*AssetPackagePath);
UE_LOG(LogHotPatcherCoreHelper, Warning, TEXT("%s already add to AssetRegistryState!"), *AssetPackagePath);
continue;
}
FAssetData* AssetData = new FAssetData();
if(UFlibAssetManageHelper::GetSingleAssetsData(AssetPackagePath,*AssetData))
if (UFlibAssetManageHelper::GetSingleAssetsData(AssetPackagePath, *AssetData))
{
if (AssetPackagePath != AssetData->ObjectPath.ToString())
{
UE_LOG(LogHotPatcherCoreHelper, Warning, TEXT("%s is a redirector of %s, skip!"), *AssetPackagePath, *AssetData->ObjectPath.ToString());
delete AssetData;
continue;
}
State.AddAssetData(AssetData);
continue;
}
Expand Down

0 comments on commit 70c5745

Please sign in to comment.