ImportAssets commandlet reimport access violation crash

If a user runs the ImportAssets commandlet to reimport an fbx asset the engine will crash with an access violation exception.

UReimportFbxSkeletalMeshFactory::Reimport attempts to check if the asset already exists in the editor’s transaction buffer. It Does this by calling GEditor->IsObjectInTransactionBuffer(SkeletalMesh); this function assumes that the UTransactor object exists and simply references it without checking for validity. This causes an access violation as the UTransactor object does not exist when running in commandlet mode.

Adding a validation check before UTransactor is access should alleviate the issue. Alternatively a check for IsRunningCommandlet can be added before GEditor->IsObjectInTransactionBuffer is called.

I had this same issue. All the members of the EditorEngine get initialized in UEditorEngine::Init(IEngineLoop* InEngineLoop) which is skipped in FEngineLoop.PreInit

FYI I put in a PR that fixes the issue a few days ago. A very simple fix if this is still causing you problems.

https://github.com/EpicGames/UnrealEngine/pull/4771