battery: fix segfault for iot-headless 62/261562/2 accepted/tizen/unified/20210722.124904 submit/tizen/20210721.083006
authorYoungjae Cho <y0.cho@samsung.com>
Wed, 21 Jul 2021 07:12:56 +0000 (16:12 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Wed, 21 Jul 2021 07:13:36 +0000 (16:13 +0900)
Change-Id: Ic88833c305694ca43723152c37212c7f92df3f16
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
src/battery/lowbat-handler.c

index 2e30239..a423c50 100644 (file)
@@ -301,13 +301,15 @@ int battery_charge_err_cf_act(void *data)
 
 int battery_charge_err_low_act(void *data)
 {
-       disp_plgn->pm_lock_internal(INTERNAL_LOCK_OVERCOOL, LCD_OFF, STAY_CUR_STATE, 60000);
+       if (disp_plgn->pm_lock_internal)
+               disp_plgn->pm_lock_internal(INTERNAL_LOCK_OVERCOOL, LCD_OFF, STAY_CUR_STATE, 60000);
        return lowbat_popup(BAT_OPT_ERR_TEMP_LOW);
 }
 
 int battery_charge_err_high_act(void *data)
 {
-       disp_plgn->pm_lock_internal(INTERNAL_LOCK_OVERHEAT, LCD_OFF, STAY_CUR_STATE, 60000);
+       if (disp_plgn->pm_lock_internal)
+               disp_plgn->pm_lock_internal(INTERNAL_LOCK_OVERHEAT, LCD_OFF, STAY_CUR_STATE, 60000);
        return lowbat_popup(BAT_OPT_ERR_TEMP_HIGH);
 }