Guard for null at startup

This commit is contained in:
John Lewin 2017-12-18 12:25:23 -08:00
parent a7f0c1f7ab
commit c49f43abf3

View file

@ -534,8 +534,11 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
// When GCode changes, switch to the 3D layer view
printer.ViewState.ViewMode = PartViewMode.Layers3D;
// HACK: directly fire method which previously ran on SlicingDone event on PrintItemWrapper
UiThread.RunOnIdle(() => printerTabPage.gcode3DWidget.CreateAndAddChildren(printer));
if (printerTabPage.gcode3DWidget != null)
{
// HACK: directly fire method which previously ran on SlicingDone event on PrintItemWrapper
UiThread.RunOnIdle(() => printerTabPage.gcode3DWidget.CreateAndAddChildren(printer));
}
}
}