Wang Xinglu / BLE_API

Dependencies:   nRF51822

Dependents:   LinkNode_LIS3DH

Fork of BLE_API by Bluetooth Low Energy

Revision:
647:8a486ffd355d
Parent:
502:557c4a9276ae
Child:
504:817c6240e9d9
diff -r 1c59b84fd7e6 -r 8a486ffd355d common/DiscoveredCharacteristic.cpp
--- a/common/DiscoveredCharacteristic.cpp	Fri Jun 19 15:52:58 2015 +0100
+++ b/common/DiscoveredCharacteristic.cpp	Fri Jun 19 15:52:58 2015 +0100
@@ -40,5 +40,9 @@
         return BLE_ERROR_OPERATION_NOT_PERMITTED;
     }
 
+    if (!gattc) {
+        return BLE_ERROR_INVALID_STATE;
+    }
+
     return gattc->write(GattClient::OP_WRITE_CMD, connHandle, length, value);
 }
\ No newline at end of file