From 148f4fe766cb7cf63972686af600d83804a2e8d3 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Fri, 20 Nov 2020 11:50:25 +0100 Subject: [PATCH] GCode Viewer - Fixed crash when switching to tool view with gcode generated by slicers other than PrusaSlicer --- src/libslic3r/GCode/GCodeProcessor.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 4d3e16b47..4785c0898 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -817,6 +817,10 @@ void GCodeProcessor::process_file(const std::string& filename, bool apply_postpr update_estimated_times_stats(); + // ensure at least one (default) color is defined + if (m_result.extruder_colors.empty()) + m_result.extruder_colors.push_back("#FF8000"); + // post-process to add M73 lines into the gcode if (apply_postprocess) m_time_processor.post_process(filename);