PCG Crashes Engine when using Attribute Remove Duplicates on partitioned data if it one of those sets of data is empty.

Hi! Thank you for your time!

Basically, as the title says PCG Crashes the engine when using Attribute Remove Duplicates node on partitioned data if it one of those sets of data is empty.

In my real project we are doing some partitioning based on mesh path and then removing duplicates and it crashes in a similar fashion in the exact same place.

I`ve seen this post in the forums https://forums.unrealengine.com/t/5-6-regression-pcg-crashing-when-using-attribute-remove-duplicates-on-a-string-custom-attribute/2553031

which seems to indicate other people have come across this issue as well.

I’ve attached as much information as I could hope it helps, good luck fixing this!

It looks like the error is coming from the following place.

PCGMetadataPartitionCommon.cpp

`UPCGData* RemoveDuplicatesPoint(const UPCGBasePointData* InData, const TArrayView& InSelectorArrayView, FPCGContext* InOptionalContext, bool bSilenceMissingAttributeErrors)
{
TArray<TArray> Partition = AttributeGenericPartition(InData, InSelectorArrayView, InOptionalContext, bSilenceMissingAttributeErrors);
if (Partition.IsEmpty())
{
return nullptr;
}

UPCGBasePointData* OutputPointData = nullptr;
TArray IndicesToCopy;
IndicesToCopy.Reserve(Partition.Num());

for (TArray& Indices : Partition)
{
// ERROR HAPPENS HERE!!
IndicesToCopy.Add(Indices[0]);
}

//…`

Steps to Reproduce
Step 1 - Open the repro project

Step 2 - Open the PCG graph named ErrorPCG

Step 3 - Click on the Remove Duplicates Node and try to debug its data

Step 4 - Notice the game crashes.

Hello,

I have put together a bug report for this, which can be tracked here if/when it’s approved for public visibility: Unreal Engine Issues and Bug Tracker (UE\-302152\). There is no ETA as priorities for bugs and features can shift at any time.

We don’t provide updates on UDN, but progress can be followed on that public issue tracker page.

Take care,

John