diff --git a/android/src/main/scala/com/nutomic/ensichat/bluetooth/BluetoothInterface.scala b/android/src/main/scala/com/nutomic/ensichat/bluetooth/BluetoothInterface.scala index e8c2371..46a2937 100644 --- a/android/src/main/scala/com/nutomic/ensichat/bluetooth/BluetoothInterface.scala +++ b/android/src/main/scala/com/nutomic/ensichat/bluetooth/BluetoothInterface.scala @@ -210,6 +210,11 @@ class BluetoothInterface(context: Context, mainHandler: Handler, * Returns all active Bluetooth connections. */ override def getConnections: Set[Address] = - connections.map(x => addressDeviceMap.find(_._2 == x._1).get._1).toSet + connections.flatMap { x => + addressDeviceMap + .find(_._2 == x._1) + .map(_._1) + } + .toSet }