ENH:add some protection for fan control

Change-Id: Ic60deaec60b5238f9307b7b4bb928293701c2fd5
This commit is contained in:
tao wang 2023-03-16 12:06:53 +08:00 committed by Lane.Wei
parent 03819e6f86
commit c6e49af3fe

View file

@ -394,7 +394,7 @@ void FanControl::command_control_fan()
{
if (m_current_speed < 0 || m_current_speed > 10) { return; }
int speed = floor(m_current_speed * float(25.5));
if (m_update_already) {
if (m_update_already && m_obj) {
m_obj->command_control_fan_val(m_type, speed);
post_event(wxCommandEvent(EVT_FAN_CHANGED));
}