Description

The following code example will generate category rows with nullptr assigned to OnPasteFromTextDelegate which causes a crash if the user tries to paste onto a row.

Once you have this code create the "CopyPasteExample" component on an actor, assign Foo to UCopyPasteCrash. This will create two category rows: UCopyPasteCrashBase and UCopyPasteCrash. If you try to paste into either of these you will crash.

#pragma once

#include "CopyPasteCrashExample.generated.h"

UCLASS(Abstract, EditInlineNew)
class UCopyPasteCrashBase : public UObject
{
   GENERATED_BODY()
public:
   UPROPERTY(EditAnywhere)
   int32 A;
};

UCLASS()
class UCopyPasteCrash : public UCopyPasteCrashBase
{
   GENERATED_BODY()
public:
   UPROPERTY(EditAnywhere)
   int32 B;
};

UCLASS(meta = (BlueprintSpawnableComponent))
class UCopyPasteCrashExample : public USceneComponent
{
   GENERATED_BODY()
public:
   UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced)
   TObjectPtr<UCopyPasteCrashBase> Foo;
};
Steps to Reproduce
  • Create custom BlueprintSpawnableComponent component from the description
  • Add the custom component to an actor.
  • Paste on it.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-228826 in the post.

0
Login to Vote

Backlogged
ComponentUE - Editor - Workflow Systems
Affects Versions5.3
CreatedOct 25, 2024
UpdatedNov 20, 2024
View Jira Issue