From 82d4b9872fe848db8645b4ed3c11944f28bcdb79 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 9 Mar 2019 12:51:33 +0200 Subject: [PATCH] Avoid errors in Auto Revert mode * lisp/autorevert.el (auto-revert-buffers): Cancel auto-revert-timer only if it is non-nil. This avoids errors on first invocation of Auto-Revert mode. --- lisp/autorevert.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/autorevert.el b/lisp/autorevert.el index d1b8f94a8e2..242344fe9d1 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -813,7 +813,8 @@ the timer when no buffers need to be checked." ;; Check if we should cancel the timer. (when (and (not global-auto-revert-mode) (null auto-revert-buffer-list)) - (cancel-timer auto-revert-timer) + (if (timerp auto-revert-timer) + (cancel-timer auto-revert-timer)) (setq auto-revert-timer nil))))) -- 2.39.2