diff --git a/src/slic3r/GUI/PresetArchiveDatabase.cpp b/src/slic3r/GUI/PresetArchiveDatabase.cpp index 46d529ca7c..b76d6bc802 100644 --- a/src/slic3r/GUI/PresetArchiveDatabase.cpp +++ b/src/slic3r/GUI/PresetArchiveDatabase.cpp @@ -184,7 +184,7 @@ std::string escape_path_by_element(const std::string& path_string) bool add_authorization_header(Http& http) { - if (wxApp::GetInstance() == nullptr) + if (wxApp::GetInstance() == nullptr || ! GUI::wxGetApp().plater()) return false; const std::string access_token = GUI::wxGetApp().plater()->get_user_account()->get_access_token(); if (!access_token.empty()) { diff --git a/src/slic3r/Utils/PresetUpdater.cpp b/src/slic3r/Utils/PresetUpdater.cpp index fcfc824305..f23ac74b11 100644 --- a/src/slic3r/Utils/PresetUpdater.cpp +++ b/src/slic3r/Utils/PresetUpdater.cpp @@ -1186,6 +1186,11 @@ PresetUpdater::UpdateResult PresetUpdater::config_update(const Semver& old_slic3 } } + if (!wxApp::GetInstance() || ! GUI::wxGetApp().plater()) { + // The main thread might have start killing the UI. + return R_NOOP; + } + // regular update if (params == UpdateParams::SHOW_NOTIFICATION) { p->set_waiting_updates(updates);