aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2023-06-25 14:31:23 +0200
committerMichael Albinus2023-06-25 14:31:23 +0200
commitfc7e7c3fde37d2038b75b2e8c27cfbbd616c85fb (patch)
tree521064d932b01c3ce1c02b9499cc003c8b9a7489
parent2aa57fe6cf973c4e7c5134958a17a478a6feb4a9 (diff)
downloademacs-fc7e7c3fde37d2038b75b2e8c27cfbbd616c85fb.tar.gz
emacs-fc7e7c3fde37d2038b75b2e8c27cfbbd616c85fb.zip
Fix type check in tramp-get-buffer-string
* lisp/net/tramp.el (tramp-get-buffer-string): Check, that BUFFER is really a bufferp.
-rw-r--r--lisp/net/tramp.el7
1 files changed, 5 insertions, 2 deletions
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."
1960 "Return contents of BUFFER. 1960 "Return contents of BUFFER.
1961If BUFFER is not a buffer or a buffer name, return the contents 1961If BUFFER is not a buffer or a buffer name, return the contents
1962of `current-buffer'." 1962of `current-buffer'."
1963 (with-current-buffer (or buffer (current-buffer)) 1963 (or (let ((buf (or buffer (current-buffer))))
1964 (substring-no-properties (buffer-string)))) 1964 (when (bufferp buf)
1965 (with-current-buffer (or buffer (current-buffer))
1966 (substring-no-properties (buffer-string)))))
1967 ""))
1965 1968
1966(defun tramp-debug-buffer-name (vec) 1969(defun tramp-debug-buffer-name (vec)
1967 "A name for the debug buffer for VEC." 1970 "A name for the debug buffer for VEC."