Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Matena <lukasmatena@seznam.cz>2022-05-26 11:11:49 +0300
committersupermerill <merill@free.fr>2022-08-10 21:58:55 +0300
commitac5d9068923c690e45195f41e2a611f099cc8eae (patch)
tree8787d4d725cbb771d8ec3fdd3013c236d084c3a1
parent48b2cdfaf97e8d98eaef430d8073d5f1b33a013c (diff)
Fix of 8299 (Linux crash when selecting locales)
-rw-r--r--src/slic3r/GUI/GUI_App.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp
index 4c58fa2ec..4cf21a36c 100644
--- a/src/slic3r/GUI/GUI_App.cpp
+++ b/src/slic3r/GUI/GUI_App.cpp
@@ -2157,15 +2157,17 @@ static const wxLanguageInfo* linux_get_existing_locale_language(const wxLanguage
}),
locales.end());
- // Is there a candidate matching a country code of a system language? Move it to the end,
- // while maintaining the order of matches, so that the best match ends up at the very end.
- std::string system_country = "_" + into_u8(system_language->CanonicalName.AfterFirst('_')).substr(0, 2);
- int cnt = locales.size();
- for (int i=0; i<cnt; ++i)
- if (locales[i].find(system_country) != std::string::npos) {
- locales.emplace_back(std::move(locales[i]));
- locales[i].clear();
- }
+ if (system_language) {
+ // Is there a candidate matching a country code of a system language? Move it to the end,
+ // while maintaining the order of matches, so that the best match ends up at the very end.
+ std::string system_country = "_" + into_u8(system_language->CanonicalName.AfterFirst('_')).substr(0, 2);
+ int cnt = locales.size();
+ for (int i=0; i<cnt; ++i)
+ if (locales[i].find(system_country) != std::string::npos) {
+ locales.emplace_back(std::move(locales[i]));
+ locales[i].clear();
+ }
+ }
// Now try them one by one.
for (auto it = locales.rbegin(); it != locales.rend(); ++ it)