From: Michael Albinus Date: Sun, 25 Jun 2023 12:31:23 +0000 (+0200) Subject: Fix type check in tramp-get-buffer-string X-Git-Tag: emacs-29.1-rc1~109 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fc7e7c3fde3;p=emacs.git Fix type check in tramp-get-buffer-string * lisp/net/tramp.el (tramp-get-buffer-string): Check, that BUFFER is really a bufferp. --- diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index b46eeb8e374..20678ec8d1a 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1960,8 +1960,11 @@ version, the function does nothing." "Return contents of BUFFER. If BUFFER is not a buffer or a buffer name, return the contents of `current-buffer'." - (with-current-buffer (or buffer (current-buffer)) - (substring-no-properties (buffer-string)))) + (or (let ((buf (or buffer (current-buffer)))) + (when (bufferp buf) + (with-current-buffer (or buffer (current-buffer)) + (substring-no-properties (buffer-string))))) + "")) (defun tramp-debug-buffer-name (vec) "A name for the debug buffer for VEC."