fix object is null and the application exit and not check lead to crash.

This commit is contained in:
alves
2026-02-05 16:49:31 +08:00
parent 64e08febbe
commit 0bc9ba7fdc
3 changed files with 88 additions and 31 deletions

View File

@@ -5974,7 +5974,9 @@ void GUI_App::open_preferences(size_t open_on_tab, const std::string& highlight_
// so we put it into an inner scope
PreferencesDialog dlg(mainframe, open_on_tab, highlight_option);
dlg.ShowModal();
this->plater_->get_current_canvas3D()->force_set_focus();
GLCanvas3D* canvas = this->plater_->get_current_canvas3D();
if (canvas)
canvas->force_set_focus();
// BBS
//app_layout_changed = dlg.settings_layout_changed();
#if ENABLE_GCODE_LINES_ID_IN_H_SLIDER