Dictionary of UObjects resets to "None" everytime i compile the derived blueprint

Hey Everyone,

So I’m making a questing system and I have a dictionary of UObjects that represent the quest. Then I derive a blueprint from that class and start populating the dictionary in-editor using my blueprint, my issue becomes that every time I hit compile on the blueprint all the data in the dictionary get set to none.

My workaround for this issue at the moment is to save all the UObject data into memory so when you hit compile it’s not an issue but I was wondering if there was another way? it’s gonna be a bit of work to set up so I was wondering if I’m just doing something wrong.

Header:

UPROPERTY(VisibleAnywhere, Category = "TaskSystem|Tasks")
TMap<FString, class UTask*> TaskList;

//Task Editing
UFUNCTION(BlueprintCallable, Category=TaskSystem)
void AddTask(FString TaskName);

Cpp:

void ATaskManager::AddTask(FString TaskName)
{
	UTask* CreatedTask = NewObject<UTask>(this, FName(*TaskName));
	if (CreatedTask)
	{
		CreatedTask->Initialize(this);
		TaskList.Add(TaskName, CreatedTask);
	}
}

Before Compile

298471-populateddictionary.png

After Compile:

298470-emptydic.png