Fixed potential crash.

This commit is contained in:
Felix Ableitner 2015-12-23 00:11:42 +01:00
parent ac12941ea8
commit c424bed315

View file

@ -68,7 +68,7 @@ class BluetoothInterface(context: Context, mainHandler: Handler,
* Stops discovery and listening.
*/
override def destroy(): Unit = {
listenThread.get.cancel()
listenThread.foreach(_.cancel())
listenThread = None
cancelDiscovery = true
try {