Editor Crash When Saving Project (Widget Components)

I have an actor that uses Widget Components and since I’ve begun working on it the editor will crash almost every time I try to save the project, be it Save Current or Save All. This only occurs in the primary project when the actor is present in a level. Making changes to this actor when it’s not in the level and saving doesn’t cause a crash. Making changes to any other actor and saving doesn’t result in the same issue in the primary project so it seems this actor in particular is the issue but I’m unsure from the crash reports what is causing it.

I migrated the same actor into a new test project and the same issue has only occurred once since testing there. I even went as far as recreating the same actor in the test project then migrating to primary project, but the same issue occurs with that migrated actor in the primary project.

The crash reports are almost always identical, but on some occasions the Frotator call is present, and the FKAggregateGeom call refers line 811 instead of 835. Otherwise all other calls after are identical and in the same order.

Atypical Crash Report

Unhandled exception

UE4Editor_Core!FRotator::Quaternion() [d:\build\++ue4\sync\engine\source\runtime\core\private\math\unrealmath.cpp:404]
UE4Editor_Engine!FKAggregateGeom::GetAggGeom() [d:\build\++ue4\sync\engine\source\runtime\engine\private\physicsengine\physdrawing.cpp:835]
UE4Editor_UMG!FWidget3DSceneProxy::RenderCollision() [d:\build\++ue4\sync\engine\source\runtime\umg\private\components\widgetcomponent.cpp:501]
UE4Editor_UMG!FWidget3DSceneProxy::GetDynamicMeshElements() [d:\build\++ue4\sync\engine\source\runtime\umg\private\components\widgetcomponent.cpp:450]
UE4Editor_Renderer!FSceneRenderer::GatherDynamicMeshElements() [d:\build\++ue4\sync\engine\source\runtime\renderer\private\scenevisibility.cpp:2723]
UE4Editor_Renderer!FSceneRenderer::ComputeViewVisibility() [d:\build\++ue4\sync\engine\source\runtime\renderer\private\scenevisibility.cpp:3717]
UE4Editor_Renderer!FDeferredShadingSceneRenderer::InitViews() [d:\build\++ue4\sync\engine\source\runtime\renderer\private\scenevisibility.cpp:3992]
UE4Editor_Renderer!FDeferredShadingSceneRenderer::Render() [d:\build\++ue4\sync\engine\source\runtime\renderer\private\deferredshadingrenderer.cpp:873]
UE4Editor_Renderer!RenderViewFamily_RenderThread() [d:\build\++ue4\sync\engine\source\runtime\renderer\private\scenerendering.cpp:3188]
UE4Editor_Renderer!TGraphTask<TEnqueueUniqueRenderCommandType<`FRendererModule::BeginRenderingViewFamily'::`27'::FDrawSceneCommandName,<lambda_ef703a768ebf46074e6be04f91ae8efa> > >::ExecuteTask() [d:\build\++ue4\sync\engine\source\runtime\core\public\async\taskgraphinterfaces.h:842]
UE4Editor_Core!FNamedTaskThread::ProcessTasksNamedThread() [d:\build\++ue4\sync\engine\source\runtime\core\private\async\taskgraph.cpp:686]
UE4Editor_Core!FNamedTaskThread::ProcessTasksUntilQuit() [d:\build\++ue4\sync\engine\source\runtime\core\private\async\taskgraph.cpp:582]
UE4Editor_RenderCore!RenderingThreadMain() [d:\build\++ue4\sync\engine\source\runtime\rendercore\private\renderingthread.cpp:333]
UE4Editor_RenderCore!FRenderingThread::Run() [d:\build\++ue4\sync\engine\source\runtime\rendercore\private\renderingthread.cpp:464]
UE4Editor_Core!FRunnableThreadWin::Run() [d:\build\++ue4\sync\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:96]

Typical Crash Report

Unhandled exception

UE4Editor_Engine!FKAggregateGeom::GetAggGeom() [d:\build\++ue4\sync\engine\source\runtime\engine\private\physicsengine\physdrawing.cpp:811]
UE4Editor_UMG!FWidget3DSceneProxy::RenderCollision() [d:\build\++ue4\sync\engine\source\runtime\umg\private\components\widgetcomponent.cpp:501]
UE4Editor_UMG!FWidget3DSceneProxy::GetDynamicMeshElements() [d:\build\++ue4\sync\engine\source\runtime\umg\private\components\widgetcomponent.cpp:450]
UE4Editor_Renderer!FSceneRenderer::GatherDynamicMeshElements() [d:\build\++ue4\sync\engine\source\runtime\renderer\private\scenevisibility.cpp:2723]
UE4Editor_Renderer!FSceneRenderer::ComputeViewVisibility() [d:\build\++ue4\sync\engine\source\runtime\renderer\private\scenevisibility.cpp:3717]
UE4Editor_Renderer!FDeferredShadingSceneRenderer::InitViews() [d:\build\++ue4\sync\engine\source\runtime\renderer\private\scenevisibility.cpp:3992]
UE4Editor_Renderer!FDeferredShadingSceneRenderer::Render() [d:\build\++ue4\sync\engine\source\runtime\renderer\private\deferredshadingrenderer.cpp:873]
UE4Editor_Renderer!RenderViewFamily_RenderThread() [d:\build\++ue4\sync\engine\source\runtime\renderer\private\scenerendering.cpp:3188]
UE4Editor_Renderer!TGraphTask<TEnqueueUniqueRenderCommandType<`FRendererModule::BeginRenderingViewFamily'::`27'::FDrawSceneCommandName,<lambda_ef703a768ebf46074e6be04f91ae8efa> > >::ExecuteTask() [d:\build\++ue4\sync\engine\source\runtime\core\public\async\taskgraphinterfaces.h:842]
UE4Editor_Core!FNamedTaskThread::ProcessTasksNamedThread() [d:\build\++ue4\sync\engine\source\runtime\core\private\async\taskgraph.cpp:686]
UE4Editor_Core!FNamedTaskThread::ProcessTasksUntilQuit() [d:\build\++ue4\sync\engine\source\runtime\core\private\async\taskgraph.cpp:582]
UE4Editor_RenderCore!RenderingThreadMain() [d:\build\++ue4\sync\engine\source\runtime\rendercore\private\renderingthread.cpp:333]
UE4Editor_RenderCore!FRenderingThread::Run() [d:\build\++ue4\sync\engine\source\runtime\rendercore\private\renderingthread.cpp:464]
UE4Editor_Core!FRunnableThreadWin::Run() [d:\build\++ue4\sync\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:96]

I tried recreating the actor by using the Add Widget component instead of adding them using Add Component button and it’s working without crashing when saving. Still would like to know why it crashes when I do it the other way though.

I encountered something similar too. In my case I was unable to save changes done to the level for as long as I had any reference to the WidgetComponent’s widget itself (getting it with GetUserWidgetObject()). I was setting a non-local reference to it during construction script, and it was always giving me this error when I tried to “Save All”:

Can't save D:/UnrealProjects/DragonGame/Content/MainContent/Maps/TutorialMap/Tutorial.umap: Graph is linked to object(s) in external map.
External Object(s):
Tutorial_Info_Widget_C_560
Tutorial_Info_Widget_C_562
Tutorial_Info_Widget_C_564
Tutorial_Info_Widget_C_566
Tutorial_Info_Widget_C_568
...
  
Try to find the chain of references to that object (may take some time)?

Setting the reference to null after doing all of the needed things during construction script, if the game is in editor mode (I just checked for GetGameState() validity) helped.