mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-05 23:05:10 +08:00
Fix of "Program crashes when [Suppress "- default -" presets:] is DISABLED"
https://github.com/prusa3d/Slic3r/issues/643
This commit is contained in:
parent
9d3ade81fa
commit
3addeb57b4
@ -596,7 +596,7 @@ sub load_configbundle {
|
|||||||
wxTheApp->{app_config}->update_config_dir(dirname($file));
|
wxTheApp->{app_config}->update_config_dir(dirname($file));
|
||||||
|
|
||||||
my $presets_imported = 0;
|
my $presets_imported = 0;
|
||||||
eval { $presets_imported = wxTheApp->{preset_bundle}->load_configbundle($file, $reset_user_profile ? 1 : 0); };
|
eval { $presets_imported = wxTheApp->{preset_bundle}->load_configbundle($file); };
|
||||||
Slic3r::GUI::catch_error($self) and return;
|
Slic3r::GUI::catch_error($self) and return;
|
||||||
|
|
||||||
# Load the currently selected preset into the GUI, update the preset selection box.
|
# Load the currently selected preset into the GUI, update the preset selection box.
|
||||||
|
@ -226,7 +226,7 @@ private:
|
|||||||
{
|
{
|
||||||
Preset key(m_type, name);
|
Preset key(m_type, name);
|
||||||
auto it = std::lower_bound(m_presets.begin() + 1, m_presets.end(), key);
|
auto it = std::lower_bound(m_presets.begin() + 1, m_presets.end(), key);
|
||||||
return (it == m_presets.end() && m_presets.front().name == name) ? m_presets.begin() : it;
|
return ((it == m_presets.end() || it->name != name) && m_presets.front().name == name) ? m_presets.begin() : it;
|
||||||
}
|
}
|
||||||
std::deque<Preset>::const_iterator find_preset_internal(const std::string &name) const
|
std::deque<Preset>::const_iterator find_preset_internal(const std::string &name) const
|
||||||
{ return const_cast<PresetCollection*>(this)->find_preset_internal(name); }
|
{ return const_cast<PresetCollection*>(this)->find_preset_internal(name); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user