From 099c209d04f09922b7fcd6b313f09492caecc66b Mon Sep 17 00:00:00 2001 From: remi durand Date: Tue, 30 Mar 2021 20:34:47 +0200 Subject: [PATCH] failsafe for UnsavedChangesDialog::update_tree --- src/slic3r/GUI/UnsavedChangesDialog.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/UnsavedChangesDialog.cpp b/src/slic3r/GUI/UnsavedChangesDialog.cpp index 95de1b44f..d3ddb9338 100644 --- a/src/slic3r/GUI/UnsavedChangesDialog.cpp +++ b/src/slic3r/GUI/UnsavedChangesDialog.cpp @@ -1100,7 +1100,9 @@ void UnsavedChangesDialog::update_tree(Preset::Type type, PresetCollection* pres ItemData item_data = { "extruders_count", local_label, old_val, new_val, type }; if(wxGetApp().get_tab(type)->get_page_count() > 0) - m_items_map.emplace(m_tree_model->AddOption(type, _L(wxGetApp().get_tab(type)->get_page(0)->title()), _L("Capabilities"), local_label, old_val, new_val, category_icon_map.at(wxGetApp().get_tab(type)->get_page(0)->title())), item_data); + m_items_map.emplace(m_tree_model->AddOption(type, _L(wxGetApp().get_tab(type)->get_page(0)->title()), _L("Capabilities"), local_label, old_val, new_val, + category_icon_map.find(wxGetApp().get_tab(type)->get_page(0)->title())!= category_icon_map.end()? category_icon_map.at(wxGetApp().get_tab(type)->get_page(0)->title()) : "wrench"), + item_data); } //TODO same for milling head? @@ -1120,7 +1122,8 @@ void UnsavedChangesDialog::update_tree(Preset::Type type, PresetCollection* pres if (old_val != item_data.old_val || new_val != item_data.new_val) item_data.is_long = true; - m_items_map.emplace(m_tree_model->AddOption(type, option.category_local, option.group_local, option.label_local, old_val, new_val, category_icon_map.at(option.category)), item_data); + m_items_map.emplace(m_tree_model->AddOption(type, option.category_local, option.group_local, option.label_local, old_val, new_val, + category_icon_map.find(option.category) != category_icon_map.end() ? category_icon_map.at(option.category) : "wrench"), item_data); } } }