From 780418435a58fc0367554db0df912cde37acc29f Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Mon, 7 Dec 2020 17:09:02 +0100 Subject: [PATCH] Fix of Custom profiles prevent the slicer from starting up #4996 Creative user made a profile inherit from itself. --- src/libslic3r/Preset.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 37575953d5..cde517aca1 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -991,7 +991,15 @@ const Preset* PresetCollection::get_preset_parent(const Preset& child) const if (it != m_presets.end()) preset = &(*it); } - return (preset == nullptr/* || preset->is_default */|| preset->is_external) ? nullptr : preset; + return + // not found + (preset == nullptr/* || preset->is_default */|| + // this should not happen, user profile should not derive from an external profile + preset->is_external || + // this should not happen, however people are creative, see GH #4996 + preset == &child) ? + nullptr : + preset; } // Return vendor of the first parent profile, for which the vendor is defined, or null if such profile does not exist.