From a2568c344982c01d2209654d587a61d497caa235 Mon Sep 17 00:00:00 2001 From: David Kocik Date: Wed, 17 Apr 2024 18:10:49 +0200 Subject: [PATCH] Additional data check --- src/slic3r/GUI/Plater.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index b5d9292b05..e595562fc0 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -5866,7 +5866,14 @@ void Plater::connect_gcode() std::string connect_filament_type = p->user_account->get_keyword_from_json(dialog_msg, "material"); std::vector compatible_printer_presets; for (const std::string& cp : compatible_printers) { - compatible_printer_presets.emplace_back(preset_bundle->printers.find_system_preset_by_model_and_variant(cp, connect_nozzle)); + const Preset* found_preset = preset_bundle->printers.find_system_preset_by_model_and_variant(cp, connect_nozzle); + if (found_preset) { + compatible_printer_presets.emplace_back(found_preset); + } + } + if (compatible_printer_presets.empty()) { + show_error(this, _L("No compatible printer presets found.")); + return; } // Selected profiles const Preset* selected_printer_preset = &preset_bundle->printers.get_selected_preset();