diff --git a/src/ios/BLECentralPlugin.m b/src/ios/BLECentralPlugin.m index a6fc90cf..ace165c9 100644 --- a/src/ios/BLECentralPlugin.m +++ b/src/ios/BLECentralPlugin.m @@ -430,9 +430,13 @@ - (void)stopScan:(CDVInvokedUrlCommand*)command { - (void)isConnected:(CDVInvokedUrlCommand*)command { + NSUUID *uuid = [self getUUID:command argumentAtIndex:0]; + if (uuid == nil) { + return; + } + + CBPeripheral *peripheral = [self findPeripheralByUUID:uuid]; CDVPluginResult *pluginResult = nil; - CBPeripheral *peripheral = [self findPeripheralByUUID:[command argumentAtIndex:0]]; - if (peripheral && peripheral.state == CBPeripheralStateConnected) { pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; } else {