]> git.eshelyaron.com Git - emacs.git/commitdiff
Make /QUIT in erc more robust
authorFrancis Litterio <flitterio@gmail.com>
Thu, 4 Feb 2016 05:55:01 +0000 (16:55 +1100)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 4 Feb 2016 05:55:01 +0000 (16:55 +1100)
* lisp/erc/erc.el (erc-kill-query-buffers): Don't bug out if we're
issuing /QUIT to disconnected servers (bug#22099).

lisp/erc/erc.el

index 3e96bb279e8e1839717884668fb6b27ece59e610..51ab20e330a1bf8e72a96245ca9861e39391b6c8 100644 (file)
@@ -6083,13 +6083,15 @@ If it doesn't exist, create it."
   (or (file-accessible-directory-p dir) (error "Cannot access %s" dir)))
 
 (defun erc-kill-query-buffers (process)
-  "Kill all buffers of PROCESS."
+  "Kill all buffers of PROCESS.
+Does nothing if PROCESS is not a process object."
   ;; here, we only want to match the channel buffers, to avoid
   ;; "selecting killed buffers" b0rkage.
-  (erc-with-all-buffers-of-server process
-    (lambda ()
-      (not (erc-server-buffer-p)))
-    (kill-buffer (current-buffer))))
+  (when (processp process)
+    (erc-with-all-buffers-of-server process
+      (lambda ()
+       (not (erc-server-buffer-p)))
+      (kill-buffer (current-buffer)))))
 
 (defun erc-nick-at-point ()
   "Give information about the nickname at `point'.