Return error code properly
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / bt-service-device.c
index e7002e9..82c81ee 100644 (file)
@@ -3375,6 +3375,11 @@ int _bt_get_att_mtu(bluetooth_device_address_t *device_address,
                BT_DBG("ATT MTU : %d", *mtu);
                g_variant_unref(value);
                g_variant_unref(result);
+
+               if (*mtu == 0) {
+                       g_object_unref(device_proxy);
+                       return BLUETOOTH_ERROR_NOT_CONNECTED;
+               }
        }
 
        g_object_unref(device_proxy);