Diff between 3bdc16d9e59cd3e740ed9f7b422e17ada30cd207 and be9fc9222c033391329e6145ccf4e81dcfcf1934
Changed Files
| File | Additions | Deletions | Status |
| src/shared/gatt-db.c | +3 | -2 | modified |
Full Patch
diff --git a/src/shared/gatt-db.c b/src/shared/gatt-db.c
index ba47c75..9a92090 100644
--- a/src/shared/gatt-db.c
+++ b/src/shared/gatt-db.c
@@ -2095,7 +2095,7 @@ bool gatt_db_attribute_write(struct gatt_db_attribute *attrib, uint16_t offset,
{
uint8_t err = 0;
- if (!attrib || !func)
+ if (!attrib || (!func && attrib->write_func))
return false;
if (attrib->write_func) {
@@ -2158,7 +2158,8 @@ bool gatt_db_attribute_write(struct gatt_db_attribute *attrib, uint16_t offset,
memcpy(&attrib->value[offset], value, len);
done:
- func(attrib, err, user_data);
+ if (func)
+ func(attrib, err, user_data);
return true;
}