handle slice/export with no objects on the table

This commit is contained in:
Stewart Allen 2019-01-09 19:02:44 -05:00
commit afc946dc2e

View file

@ -921,7 +921,7 @@ var gs_kiri_cam = exports;
widgetCount = widgetArray.length, widgetCount = widgetArray.length,
widget = widgetArray[widgetIndex]; widget = widgetArray[widgetIndex];
if (widgetIndex >= widgetCount || !widget) return; if (widgetIndex >= widgetCount || !widget || !widget.getCamBounds) return;
var slices = widget.slices, var slices = widget.slices,
bounds = widget.getCamBounds(settings), bounds = widget.getCamBounds(settings),
@ -1370,6 +1370,8 @@ var gs_kiri_cam = exports;
* @returns {Array} gcode lines * @returns {Array} gcode lines
*/ */
function printExport(print, online) { function printExport(print, online) {
if (!widget) return;
var i, var i,
time = 0, time = 0,
lines = 0, lines = 0,