emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 fc7e7c3fde3: Fix type check in tramp-get-buffer-string


From: Michael Albinus
Subject: emacs-29 fc7e7c3fde3: Fix type check in tramp-get-buffer-string
Date: Sun, 25 Jun 2023 08:31:37 -0400 (EDT)

branch: emacs-29
commit fc7e7c3fde37d2038b75b2e8c27cfbbd616c85fb
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>

    Fix type check in tramp-get-buffer-string
    
    * lisp/net/tramp.el (tramp-get-buffer-string): Check, that BUFFER
    is really a bufferp.
---
 lisp/net/tramp.el | 7 +++++--
 1 file 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."
   "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."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]