summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWootak Jung <wootak.jung@samsung.com>2024-02-01 15:45:38 +0900
committerWootak Jung <wootak.jung@samsung.com>2024-02-01 15:45:38 +0900
commitaf42defdccdb21ac156fd707ba68c6f52d016f8e (patch)
tree6ca39d42234368fabfca8cc0fe98f45fd3c2ec83
parent3bc50d0b8c4c2896f6ffac675dd2ec7bdca4a762 (diff)
downloadbluetooth-af42defdccdb21ac156fd707ba68c6f52d016f8e.tar.gz
bluetooth-af42defdccdb21ac156fd707ba68c6f52d016f8e.tar.bz2
bluetooth-af42defdccdb21ac156fd707ba68c6f52d016f8e.zip
Fix crash issue when write_cb is NULLaccepted/tizen/7.0/unified/20240205.015610
Change-Id: I4dc116d88a8d527ffc865e2fbeeed17e5365fde3 Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
-rw-r--r--src/bluetooth-gatt.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bluetooth-gatt.c b/src/bluetooth-gatt.c
index fb72744..b485875 100644
--- a/src/bluetooth-gatt.c
+++ b/src/bluetooth-gatt.c
@@ -4210,8 +4210,10 @@ int bt_gatt_client_write_value(bt_gatt_h gatt_handle,
chr->write_user_data = user_data;
}
- if (chr->write_type == BT_GATT_WRITE_TYPE_WRITE_NO_RESPONSE)
- chr->write_cb(ret, gatt_handle, user_data);
+ if (chr->write_type == BT_GATT_WRITE_TYPE_WRITE_NO_RESPONSE) {
+ if (chr->write_cb)
+ chr->write_cb(ret, gatt_handle, user_data);
+ }
} else if (c->type == BT_GATT_TYPE_DESCRIPTOR) {
bt_gatt_descriptor_s *desc = (bt_gatt_descriptor_s *)gatt_handle;