mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 02:22:17 +00:00
FIX:deal null pointer
jira: github 7109 Change-Id: I1db1dd1b306a33c80b256a7b6f9460ad3d35d1db (cherry picked from commit c79311e3ee2d13dcfd733e413812c5b52f6aac9c)
This commit is contained in:
@@ -4899,14 +4899,21 @@ void Plater::priv::select_view(const std::string& direction)
|
||||
|
||||
const VendorProfile::PrinterModel *Plater::get_curr_printer_model()
|
||||
{
|
||||
auto bundle = wxGetApp().preset_bundle;
|
||||
const Preset * curr = &bundle->printers.get_selected_preset();
|
||||
const VendorProfile::PrinterModel *pm = PresetUtils::system_printer_model(*curr);
|
||||
if (!pm) {
|
||||
auto curr_parent = bundle->printers.get_selected_preset_parent();
|
||||
pm = PresetUtils::system_printer_model(*curr_parent);
|
||||
auto bundle = wxGetApp().preset_bundle;
|
||||
if (bundle) {
|
||||
const Preset *curr = &bundle->printers.get_selected_preset();
|
||||
if (curr) {
|
||||
const VendorProfile::PrinterModel *pm = PresetUtils::system_printer_model(*curr);
|
||||
if (!pm) {
|
||||
auto curr_parent = bundle->printers.get_selected_preset_parent();
|
||||
if (curr_parent) {
|
||||
pm = PresetUtils::system_printer_model(*curr_parent);
|
||||
}
|
||||
}
|
||||
return pm;
|
||||
}
|
||||
}
|
||||
return pm;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
wxColour Plater::get_next_color_for_filament()
|
||||
|
||||
Reference in New Issue
Block a user