SPE-2679: Missing error code in fs::exists causes crash.

This commit is contained in:
David Kocik 2025-02-10 13:40:53 +01:00 committed by Lukas Matena
parent b9703147ad
commit d593929494

View File

@ -838,7 +838,8 @@ void Plater::priv::init()
}); });
this->q->Bind(EVT_REMOVABLE_DRIVE_ADDED, [this](wxCommandEvent& evt) { this->q->Bind(EVT_REMOVABLE_DRIVE_ADDED, [this](wxCommandEvent& evt) {
if (!fs::exists(fs::path(evt.GetString().utf8_string()) / "prusa_printer_settings.ini")) boost::system::error_code ec;
if (!fs::exists(fs::path(evt.GetString().utf8_string()) / "prusa_printer_settings.ini", ec) || ec)
return; return;
if (evt.GetInt() == 0) { // not at startup, show dialog if (evt.GetInt() == 0) { // not at startup, show dialog
wxGetApp().open_wifi_config_dialog(false, evt.GetString()); wxGetApp().open_wifi_config_dialog(false, evt.GetString());
@ -852,7 +853,6 @@ void Plater::priv::init()
wxGetApp().open_wifi_config_dialog(true, evt.GetString()); wxGetApp().open_wifi_config_dialog(true, evt.GetString());
return true;}); return true;});
} }
}); });
// Start the background thread and register this window as a target for update events. // Start the background thread and register this window as a target for update events.