Fixed potential crash.
This commit is contained in:
parent
ac12941ea8
commit
c424bed315
1 changed files with 1 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Reference in a new issue