Crash in FAssetEditorToolkit::RegenerateMenusAndToolbars()

Summary

Editor crashes in AssetEditorToolkit.cpp :

void FAssetEditorToolkit::RegenerateMenusAndToolbars()
{
RemoveAllToolbarWidgets();

TSharedPtr<SStandaloneAssetEditorToolkitHost> HostWidget = StandaloneHost.Pin();
if (HostWidget)
{
	HostWidget->GenerateMenus(false);
}

if (Toolbar != SNullWidget::NullWidget)
{
	GenerateToolbar();
}

PostRegenerateMenusAndToolbars();

HostWidget->SetToolbar(Toolbar);  // THIS HERE CRASHES AS IT WAS A NULL POINTER

}

Please select what you are reporting on:

Creative

What Type of Bug are you experiencing?

UI/Tools

Steps to Reproduce

I was fiddling somewhere in a control rig assets blueprint, then wanted to shut down Unreal whilst in a DebugGame Editor build

Expected Result

No crash, it does do check:
if (HostWidget)
{
HostWidget->GenerateMenus(false);
}

but then for whatevr reason HostWidget->SetToolbar(Toolbar); is not checked, and HostWidget is not there

Observed Result

it crashes

Platform(s)

PC

Additional Notes

callstack:

[Inline Frame] UnrealEditor-UnrealEd.dll!TSharedPtr<SWidget,1>::operator bool() Line 1047 C++
UnrealEditor-UnrealEd.dll!SStandaloneAssetEditorToolkitHost::SetToolbar(TSharedPtr<SWidget,1> Toolbar) Line 257 C++
UnrealEditor-UnrealEd.dll!FAssetEditorToolkit::RegenerateMenusAndToolbars() Line 1504 C++
UnrealEditor-RigVMEditor.dll!FRigVMEditor::InitRigVMEditor(const EToolkitMode::Type Mode, const TSharedPtr<IToolkitHost,1> & InitToolkitHost, URigVMBlueprint * InRigVMBlueprint) Line 225 C++
UnrealEditor-ControlRigEditor.dll!FControlRigEditor::InitRigVMEditor(const EToolkitMode::Type Mode, const TSharedPtr<IToolkitHost,1> & InitToolkitHost, URigVMBlueprint * InRigVMBlueprint) Line 342 C++
UnrealEditor-ControlRigEditor.dll!FControlRigEditorModule::CreateControlRigEditor(const EToolkitMode::Type Mode, const TSharedPtr<IToolkitHost,1> & InitToolkitHost, UControlRigBlueprint * InBlueprint) Line 1497 C++
UnrealEditor-ControlRigEditor.dll!FControlRigBlueprintActions::OpenAssetEditor(const TArray<UObject *,TSizedDefaultAllocator<32>> & InObjects, TSharedPtr<IToolkitHost,1> EditWithinLevelEditor) Line 72 C++
UnrealEditor-ControlRigEditor.dll!FAssetTypeActions_Base::OpenAssetEditor(const TArray<UObject *,TSizedDefaultAllocator<32>> & InObjects, const EAssetTypeActivationOpenedMethod OpenedMethod, TSharedPtr<IToolkitHost,1> EditWithinLevelEditor) Line 43 C++
UnrealEditor-UnrealEd.dll!UAssetEditorSubsystem::OpenEditorForAsset(UObject * Asset, const EToolkitMode::Type ToolkitMode, TSharedPtr<IToolkitHost,1> OpenedFromLevelEditor, const bool bShowProgressWindow, EAssetTypeActivationOpenedMethod OpenedMethod) Line 577 C++
UnrealEditor-UnrealEd.dll!UAssetEditorSubsystem::OpenEditorForAsset(const FSoftObjectPath & AssetPath, const EAssetTypeActivationOpenedMethod OpenedMethod) Line 842 C++
UnrealEditor-Engine.dll!FTimerUnifiedDelegate::Execute() Line 367 C++
UnrealEditor-Engine.dll!FTimerManager::Tick(float DeltaTime) Line 1065 C++
UnrealEditor-UnrealEd.dll!UEditorEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 1749 C++
UnrealEditor-UnrealEd.dll!UUnrealEdEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 550 C++
UnrealEditor-Win64-DebugGame.exe!FEngineLoop::Tick() Line 5877 C++
[Inline Frame] UnrealEditor-Win64-DebugGame.exe!EngineTick() Line 69 C++
UnrealEditor-Win64-DebugGame.exe!GuardedMain(const wchar_t * CmdLine) Line 188 C++
UnrealEditor-Win64-DebugGame.exe!LaunchWindowsStartup(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * formal, int nCmdShow, const wchar_t * CmdLine) Line 266 C++
UnrealEditor-Win64-DebugGame.exe!WinMain(HINSTANCE
* hInInstance, HINSTANCE__ * hPrevInstance, char * pCmdLine, int nCmdShow) Line 317 C++
[External Code]