branch: externals/bluetooth
commit 9ef5b085bafe59f6bc21a392ac9c795710c33464
Author: Raffael Stocker <[email protected]>
Commit: Raffael Stocker <[email protected]>

    cancel update timer in StopDiscovery only if it is active
---
 bluetooth.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/bluetooth.el b/bluetooth.el
index 3bceacf8c4..5fbc8dd790 100644
--- a/bluetooth.el
+++ b/bluetooth.el
@@ -4521,8 +4521,9 @@ profiles."
 
 (bluetooth-defun-method "StopDiscovery" :adapter
   "Stop discovery mode."
-  (cancel-timer bluetooth--update-timer)
-  (setq bluetooth--update-timer nil))
+  (when bluetooth--update-timer
+       (cancel-timer bluetooth--update-timer)
+       (setq bluetooth--update-timer nil)))
 
 (bluetooth-defun-method "Pair" :device
   "Pair with device at point.")

Reply via email to