Fix type check in tramp-get-buffer-string

* lisp/net/tramp.el (tramp-get-buffer-string): Check, that BUFFER
is really a bufferp.
This commit is contained in:
Michael Albinus 2023-06-25 14:31:23 +02:00
parent 2aa57fe6cf
commit fc7e7c3fde

View file

@ -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'."
(or (let ((buf (or buffer (current-buffer))))
(when (bufferp buf)
(with-current-buffer (or buffer (current-buffer))
(substring-no-properties (buffer-string))))
(substring-no-properties (buffer-string)))))
""))
(defun tramp-debug-buffer-name (vec)
"A name for the debug buffer for VEC."