mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-02-20 11:32:31 -07:00
FIX: Fix the issue where the 'get_imilar_printer_preset' method returns a null pointer
Jira: 9935 Change-Id: I4b001721780162d656b73df316387a33967e4a2c (cherry picked from commit 2ec50f771f07d7ca6dafde77b7683eb18ee7c554)
This commit is contained in:
parent
aa9fb1fd34
commit
e05d81c797
1 changed files with 4 additions and 1 deletions
|
|
@ -2539,7 +2539,10 @@ Preset *PresetBundle::get_similar_printer_preset(std::string printer_model, std:
|
|||
if (printer_model.empty())
|
||||
printer_model = printers.get_selected_preset().config.opt_string("printer_model");
|
||||
auto printer_variant_old = printers.get_selected_preset().config.opt_string("printer_variant");
|
||||
auto printer_names = get_printer_names_by_printer_type_and_nozzle(printer_model, printer_variant.empty() ? printer_variant_old : printer_variant, !printer_model.empty());
|
||||
std::set<std::string> printer_names;
|
||||
for (auto &preset : printers.m_presets) {
|
||||
if (preset.config.opt_string("printer_model") == printer_model) printer_names.insert(preset.name);
|
||||
}
|
||||
if (printer_names.empty())
|
||||
return nullptr;
|
||||
auto prefer_printer = printers.get_selected_preset().name;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue