Skip to content

Commit b173619

Browse files
author
Michał Narajowski
authored
Merge pull request apache#76 from michal-narajowski/ias-cb-fix
nimble/host: Add check before calling a IAS event callback
2 parents 675dab9 + 1b5a8ca commit b173619

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

nimble/host/services/ias/src/ble_svc_ias.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,10 @@ ble_svc_ias_access(uint16_t conn_handle, uint16_t attr_handle,
103103
sizeof ble_svc_ias_alert_level,
104104
sizeof ble_svc_ias_alert_level,
105105
&ble_svc_ias_alert_level, NULL);
106-
/* Call the IAS event function */
107-
ble_svc_ias_cb_fn(ble_svc_ias_alert_level);
106+
/* Call the IAS event function */
107+
if (ble_svc_ias_cb_fn) {
108+
ble_svc_ias_cb_fn(ble_svc_ias_alert_level);
109+
}
108110
return rc;
109111

110112
default:

0 commit comments

Comments
 (0)