From 8c562b2d7f6378b71e0dcbc172a4dd6673895256 Mon Sep 17 00:00:00 2001 From: Francis Litterio Date: Thu, 4 Feb 2016 16:55:01 +1100 Subject: [PATCH] Make /QUIT in erc more robust * 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 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 3e96bb279e8..51ab20e330a 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -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'. -- 2.39.2