diff --git a/thermometer/thermometer.c b/thermometer/thermometer.c
index bc05edc..e78d250 100644
--- a/thermometer/thermometer.c
+++ b/thermometer/thermometer.c
struct characteristic *ch;
guint8 atval[2];
+ if (t->attrib == NULL)
+ return btd_error_not_connected(msg);
+
ch = get_characteristic(t, MEASUREMENT_INTERVAL_UUID);
if (ch == NULL)
return btd_error_not_available(msg);
uint8_t atval[2];
gchar *msg;
+ if (t->attrib == NULL)
+ return;
+
ch = get_characteristic(t, TEMPERATURE_MEASUREMENT_UUID);
if (ch == NULL) {
DBG("Temperature measurement characteristic not found");
uint8_t atval[2];
gchar *msg;
+ if (t->attrib == NULL)
+ return;
+
ch = get_characteristic(t, INTERMEDIATE_TEMPERATURE_UUID);
if (ch == NULL) {
DBG("Intermediate measurement characteristic not found");
uint8_t atval[2];
gchar *msg;
+ if (t->attrib == NULL)
+ return;
+
ch = get_characteristic(t, TEMPERATURE_MEASUREMENT_UUID);
if (ch == NULL) {
DBG("Temperature measurement characteristic not found");
uint8_t atval[2];
gchar *msg;
+ if (t->attrib == NULL)
+ return;
+
ch = get_characteristic(t, INTERMEDIATE_TEMPERATURE_UUID);
if (ch == NULL) {
DBG("Intermediate measurement characteristic not found");