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