]> git.eshelyaron.com Git - emacs.git/commitdiff
Small erc-kill-channel fix (bug#23700)
authorFran Litterio <flitterio@gmail.com>
Tue, 18 Apr 2017 00:30:40 +0000 (20:30 -0400)
committerGlenn Morris <rgm@gnu.org>
Tue, 18 Apr 2017 00:30:40 +0000 (20:30 -0400)
* lisp/erc/erc.el (erc-kill-channel): Handle null erc-default-target.

lisp/erc/erc.el

index 488404d7341f2b17162a9029bf95d5e9a113560b..7e19ebbf980cdb872613620e3e7e6dda03725a01 100644 (file)
@@ -6735,9 +6735,10 @@ This function should be on `erc-kill-server-hook'."
 This function should be on `erc-kill-channel-hook'."
   (when (erc-server-process-alive)
     (let ((tgt (erc-default-target)))
-      (erc-server-send (format "PART %s :%s" tgt
-                               (funcall erc-part-reason nil))
-                       nil tgt))))
+      (if tgt
+         (erc-server-send (format "PART %s :%s" tgt
+                                  (funcall erc-part-reason nil))
+                          nil tgt)))))
 
 ;;; Dealing with `erc-parsed'