From 852c5805695c92b9d3edd9e47be4b565da8d3576 Mon Sep 17 00:00:00 2001 From: "chunmao.guo" Date: Mon, 17 Mar 2025 13:41:29 +0800 Subject: [PATCH] FIX: OptionsSearcher::get_option crash for z_hop_types Change-Id: I84d234628335505e44e984dc1dddff4822d44346 Jira: STUDIO-10886 --- src/slic3r/GUI/Search.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/Search.cpp b/src/slic3r/GUI/Search.cpp index 17d7d5cd5..787e8bf5f 100644 --- a/src/slic3r/GUI/Search.cpp +++ b/src/slic3r/GUI/Search.cpp @@ -332,9 +332,9 @@ const Option &OptionsSearcher::get_option(const std::string &opt_key, Preset::Ty variant_index = -1; } else if (it->opt_key() != opt_key) { auto it2 = it; - while (it2 != options.end() && it2->opt_key() != opt_key && it2->opt_key().compare(0, opt_key2.length(), opt_key2) == 0) + while (it2 != options.end() && it2->opt_key() != opt_key && it2->opt_key().compare(0, opt_key2.length(), opt_key2) != 0) ++it2; - if (it2->opt_key() == opt_key) + if (it2 != options.end() && it2->opt_key() == opt_key) it = it2; if (it2 == it) variant_index = -2;