mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-01 18:00:39 +08:00
Couple more ad-hoc fixes for crashes on startup
This commit is contained in:
parent
d2bed746b0
commit
2be3c9f867
@ -184,7 +184,7 @@ std::string escape_path_by_element(const std::string& path_string)
|
|||||||
|
|
||||||
bool add_authorization_header(Http& http)
|
bool add_authorization_header(Http& http)
|
||||||
{
|
{
|
||||||
if (wxApp::GetInstance() == nullptr)
|
if (wxApp::GetInstance() == nullptr || ! GUI::wxGetApp().plater())
|
||||||
return false;
|
return false;
|
||||||
const std::string access_token = GUI::wxGetApp().plater()->get_user_account()->get_access_token();
|
const std::string access_token = GUI::wxGetApp().plater()->get_user_account()->get_access_token();
|
||||||
if (!access_token.empty()) {
|
if (!access_token.empty()) {
|
||||||
|
@ -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
|
// regular update
|
||||||
if (params == UpdateParams::SHOW_NOTIFICATION) {
|
if (params == UpdateParams::SHOW_NOTIFICATION) {
|
||||||
p->set_waiting_updates(updates);
|
p->set_waiting_updates(updates);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user