Skip to content

Commit

Permalink
fix serialize json crash issues 2
Browse files Browse the repository at this point in the history
  • Loading branch information
hxhb committed Jan 5, 2022
1 parent 24036e5 commit 777520b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "DependenciesParser/FDefaultAssetDependenciesParser.h"
#include "FlibAssetManageHelper.h"
#include "HotPatcherLog.h"


void FAssetDependenciesParser::Parse(const FAssetDependencies& ParseConfig)
Expand Down Expand Up @@ -51,14 +52,19 @@ void FAssetDependenciesParser::Parse(const FAssetDependencies& ParseConfig)
SCOPED_NAMED_EVENT_TCHAR(TEXT("Get dependencies for SpecifyAsset"),FColor::Red);
for(const auto& SpecifyAsset:ParseConfig.InIncludeSpecifyAsset)
{
if(!SpecifyAsset.Asset.IsValid())
{
continue;
}
Results.Add(FName(SpecifyAsset.Asset.GetLongPackageName()));
if(SpecifyAsset.bAnalysisAssetDependencies)
{
Results.Append(FAssetDependenciesParser::GatherAssetDependicesInfoRecursively(AssetRegistryModule,FName(SpecifyAsset.Asset.GetLongPackageName()),SpecifyAsset.AssetRegistryDependencyTypes,SpecifyAsset.bAnalysisAssetDependencies,TSet<FName>{},ScanedCaches));
}
}
}


Results.Remove(FName(NAME_None));
}

bool IsValidPackageName(const FString& LongPackageName)
Expand Down Expand Up @@ -102,7 +108,7 @@ TSet<FName> FAssetDependenciesParser::GatherAssetDependicesInfoRecursively(FAsse
for (auto &LongPackageName : CurrentAssetDependencies)
{
// ignore /Script/WeatherSystem and self
if(!IsValidPackageName(LongPackageName.ToString()) || LongPackageName == InLongPackageName)
if(LongPackageName.IsNone() || !IsValidPackageName(LongPackageName.ToString()) || LongPackageName == InLongPackageName)
continue;
AssetDependencies.Add(LongPackageName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,8 @@ FChunkAssetDescribe UFlibPatchParserHelper::CollectFChunkAssetsDescribeByChunk(
// AssetFilterPaths.Append(SpecifyDependAssets.GetAssetLongPackageNames());
for(FName LongPackageName:AssetLongPackageNames)
{
if(LongPackageName.IsNone())
continue;
AssetFilterPaths.AddUnique(LongPackageName.ToString());
}

Expand Down Expand Up @@ -1296,12 +1298,13 @@ FHotPatcherVersion UFlibPatchParserHelper::ExportReleaseVersionInfo(
SCOPED_NAMED_EVENT_TCHAR(TEXT("combine all assets to FAssetDependenciesInfo"),FColor::Red);
for(FName LongPackageName:Parser.GetrParseResults())
{
if(LongPackageName.IsNone())
continue;
FAssetDetail CurrentDetail;
if(UFlibAssetManageHelper::GetSpecifyAssetDetail(LongPackageName.ToString(),CurrentDetail))
{
ExportVersion.AssetInfo.AddAssetsDetail(CurrentDetail);
}

}
}
}
Expand Down

0 comments on commit 777520b

Please sign in to comment.