Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add missing connection check for disconnect
  • Loading branch information
dati91 committed Dec 5, 2016
1 parent 9a45252 commit 6749b6a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/script/dom/bluetoothremotegattserver.rs
Expand Up @@ -90,7 +90,10 @@ impl BluetoothRemoteGATTServerMethods for BluetoothRemoteGATTServer {
fn Disconnect(&self) -> ErrorResult {
// TODO: Step 1: Implement activeAlgorithms internal slot for BluetoothRemoteGATTServer.

// TODO: Step 2: Check if this.connected is false here too.
// Step 2.
if !self.Connected() {
return Ok(());
}
let (sender, receiver) = ipc::channel().unwrap();
self.get_bluetooth_thread().send(
BluetoothRequest::GATTServerDisconnect(String::from(self.Device().Id()), sender)).unwrap();
Expand Down

0 comments on commit 6749b6a

Please sign in to comment.