FIX: Crash when switch to the calibration page

after binding the printer in device page
jira: 4080

Change-Id: I8e712389bf619b177255111766c271cb9f1bf66e
(cherry picked from commit a012b3641713d7f1e3ae60688c2db8054d3cd731)
This commit is contained in:
zhimin.zeng 2023-08-29 11:33:13 +08:00 committed by Lane.Wei
parent e7fcd330ba
commit caac160c7f

View file

@ -526,6 +526,14 @@ void CalibrationPanel::update_all() {
if (!dev) return;
obj = dev->get_selected_machine();
// check valid machine
if (obj && dev->get_my_machine(obj->dev_id) == nullptr) {
dev->set_selected_machine("");
if (m_agent) m_agent->set_user_selected_machine("");
show_status((int) MONITOR_NO_PRINTER);
return;
}
// update current wizard only
int curr_selected = m_tabpanel->GetSelection();
@ -543,15 +551,6 @@ void CalibrationPanel::update_all() {
}
}
// check valid machine
if (obj && dev->get_my_machine(obj->dev_id) == nullptr) {
dev->set_selected_machine("");
if (m_agent)
m_agent->set_user_selected_machine("");
show_status((int)MONITOR_NO_PRINTER);
return;
}
if (wxGetApp().is_user_login()) {
dev->check_pushing();
try {