From ad770bfa226f79e52aa1c334ef477e28c8d5db82 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Sun, 17 Sep 2017 12:12:58 -0700 Subject: [PATCH] Handle null printer case for 'Create Part' mode --- PartPreviewWindow/ViewGcodeBasic.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)