#6730 - GCodeViewer -> Fixed crash when importing gcode files generated by PrusaSlicer and edited by user or 3rd part post processors by appending new lines after the config section. Show instead the same error dialog as when trying to import the config into PrusaSlicer from the same gcode file

This commit is contained in:
enricoturri1966
2021-07-21 08:36:16 +02:00
parent 5a11f8069d
commit 712c7e80aa

View File

@@ -4898,7 +4898,15 @@ void Plater::load_gcode(const wxString& filename)
// process gcode
GCodeProcessor processor;
processor.enable_producers(true);
processor.process_file(filename.ToUTF8().data(), false);
try
{
processor.process_file(filename.ToUTF8().data(), false);
}
catch (const std::exception& ex)
{
show_error(this, ex.what());
return;
}
p->gcode_result = std::move(processor.extract_result());
// show results