diff --git a/attrib/gatt.c b/attrib/gatt.c
index b8d766c..4bffd64 100644
--- a/attrib/gatt.c
+++ b/attrib/gatt.c
{
struct discover_char *dc = user_data;
struct att_data_list *list;
- unsigned int i, err = ATT_ECODE_ATTR_NOT_FOUND;
+ unsigned int i, err = 0;
uint16_t last = 0;
uint8_t type;
+ /* We have all the characteristic now, lets send it up */
+ if (status == ATT_ECODE_ATTR_NOT_FOUND) {
+ err = dc->characteristics ? 0 : status;
+ goto done;
+ }
+
if (status) {
err = status;
goto done;
}
done:
- err = (dc->characteristics ? 0 : err);
dc->cb(err, dc->characteristics, dc->user_data);
}