Unreal is Crashing When Trying to Open Level with C++ code

I am developing a plugin for asset management in Unreal. I am trying to create a new level, open it, and populate the scene with some assets. When I try to open a level (even one I’ve created through the unreal gui), I get the following crash message:

The snippet of code that crashes is:

	FString packageString = "/Game/Levels/" + worldName;
	FString outString;
	FPackageName::TryConvertLongPackageNameToFilename(packageString, outString, ".umap");
	FEditorFileUtils::LoadMap(outString, false, true)