Commandlet savemap crash

Now I’m working on a project that auto loads && save levels. And I want use a commandlet to do these work just like

I use UEditorLoadingAndSavingUtils to load and save levels,here is my main() function:

int32 UAutoImportCommandlet::Main(const FString& Params)

{
         UWorld* world;
	     world = UEditorLoadingAndSavingUtils::LoadMap("Gama/MyMapFile");
	     if (world == nullptr)UE_LOG(LogTemp, Warning, TEXT("WorldPtr is null"));
	     UEditorLoadingAndSavingUtils::SaveMap(world, FString("Path_to_save"));
}

but when I use the commandlet, it always crashed with logs:

Assertion failed: IsValid() [File:d:\unreal engine 4\unrealengine-release\engine\source\runtime\core\public\Templates/SharedPointer.h] [Line: 838]

and I also found that when I load a umap file after running my commandlet, the .umap file will appear in destination folder while without *BuildData.uasset file.

However if I load a empty level without any actors,this commandlet work fine. so I think this error may be caused by these assets in my loaded level.But I don’t know how to solve it.

Any suggestiones will be grateful!

add some logs:
[2019.08.08-06.34.13:684][ 0]Cmd: MAP LOAD FILE="…/…/…/…/…/Project/MyWorkSpace/Content/ThirdPersonCPP/Maps/ThirdPersonExampleMap.umap" TEMPLATE=0 SHOWPROGRESS=1 FEATURELEVEL=3
[2019.08.08-06.34.13:685][ 0]LightingResults: New page: Lighting Build
[2019.08.08-06.34.13:686][ 0]LoadErrors: New page: Loading map: ThirdPersonExampleMap.umap
[2019.08.08-06.34.13:707][ 0]LogUObjectHash: Compacting FUObjectHashTables data took 1.42ms
[2019.08.08-06.34.13:774][ 0]LogAIModule: Creating AISystem for world ThirdPersonExampleMap
[2019.08.08-06.34.13:795][ 0]LogEditorServer: Finished looking for orphan Actors (0.000 secs)
[2019.08.08-06.34.13:822][ 0]LogUObjectHash: Compacting FUObjectHashTables data took 1.44ms
[2019.08.08-06.34.13:822][ 0]Cmd: MAP CHECKDEP NOCLEARLOG
[2019.08.08-06.34.13:822][ 0]MapCheck: Map check complete: 0 Error(s), 0 Warning(s), took 0.094ms to complete.
[2019.08.08-06.34.13:822][ 0]LogFileHelpers: Loading map ‘ThirdPersonExampleMap’ took 0.138
[2019.08.08-06.34.14:387][ 0]LogUObjectHash: Compacting FUObjectHashTables data took 1.29ms
[2019.08.08-06.34.14:987][ 0]Cmd: OBJ SAVEPACKAGE PACKAGE="/Game/map" FILE="…/…/…/…/…/Project/MyWorkSpace/Content/map.umap" SILENT=true AUTOSAVING=false KEEPDIRTY=false
[2019.08.08-06.34.14:997][ 0]LogAIModule: Creating AISystem for world map
[2019.08.08-06.34.15:132][ 0]LogSavePackage: Moving ‘…/…/…/…/…/Project/MyWorkSpace/Saved/map16DF07D5489E15D14D7BDABDCCCADF57.tmp’ to ‘…/…/…/…/…/Project/MyWorkSpace/Content/map.umap’
[2019.08.08-06.34.15:186][ 0]LogOutputDevice: Warning:

Script Stack (0 frames):

[2019.08.08-06.34.15:187][ 0]LogWindows: Windows GetLastError: 操作成功完成。 (0)
[2019.08.08-06.34.35:547][ 0]LogWindows: Warning: CreateProc failed: 系统找不到指定的文件。 (0x00000002)