diff options
-rw-r--r-- | lisp/erc/erc.el | 12 |
1 files 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'. |