emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] [minimap] Fix minimap-kill when there is no timer object


From: emacs-devel
Subject: [PATCH] [minimap] Fix minimap-kill when there is no timer object
Date: Sun, 13 Sep 2020 12:39:16 +0100

From: Adam Spiers <emacs@adamspiers.org>

Occasionally minimap-timer-object can be nil when minimap-killer
is triggered.  In this case, the following error is triggered:

    cancel-timer: Wrong type argument: timerp, nil

So defensively check whether there is a timer to cancel before trying
to cancel it.

Signed-off-by: Adam Spiers <emacs@adamspiers.org>
---
 packages/minimap/minimap.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/packages/minimap/minimap.el b/packages/minimap/minimap.el
index c360673c4..73d7fb2f1 100644
--- a/packages/minimap/minimap.el
+++ b/packages/minimap/minimap.el
@@ -531,7 +531,8 @@ (defun minimap-kill ()
   (interactive)
   (when (minimap-get-window)
     (delete-window (minimap-get-window)))
-  (cancel-timer minimap-timer-object))
+  (when minimap-timer-object
+    (cancel-timer minimap-timer-object)))
 
 ;;; Minimap update
 
-- 
2.28.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]