diff --git a/PartPreviewWindow/ViewGcodeBasic.cs b/PartPreviewWindow/ViewGcodeBasic.cs index c712c6700..3c267976c 100644 --- a/PartPreviewWindow/ViewGcodeBasic.cs +++ b/PartPreviewWindow/ViewGcodeBasic.cs @@ -77,7 +77,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow }, ref unregisterEvents); // TODO: Why do we clear GCode on AdvancedControlsPanelReloading - assume some slice settings should invalidate. If so, code should be more specific and bound to slice settings changed - ApplicationController.Instance.AdvancedControlsPanelReloading.RegisterEvent((s, e) => printer.Bed.GCodeRenderer?.Clear3DGCode(), ref unregisterEvents); + ApplicationController.Instance.AdvancedControlsPanelReloading.RegisterEvent((s, e) => printer?.Bed.GCodeRenderer?.Clear3DGCode(), ref unregisterEvents); } internal void CreateAndAddChildren(PrinterConfig printer)