]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix error in tramp-process-sentinel
authorMichael Albinus <michael.albinus@gmx.de>
Fri, 20 Dec 2019 12:32:24 +0000 (13:32 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Fri, 20 Dec 2019 12:32:24 +0000 (13:32 +0100)
* lisp/net/tramp.el (tramp-process-sentinel): Check, that process
buffer is alive.

lisp/net/tramp.el

index 4b44d7a803135495b0761609c1338b3c5548a2d8..36bfe5ef865cca765a95191bbbb9a983d004b2da 100644 (file)
@@ -4301,14 +4301,16 @@ the remote host use line-endings as defined in the variable
   "Flush file caches and remove shell prompt."
   (unless (process-live-p proc)
     (let ((vec (process-get proc 'vector))
+         (buf (process-buffer proc))
          (prompt (tramp-get-connection-property proc "prompt" nil)))
       (when vec
        (tramp-message vec 5 "Sentinel called: `%S' `%s'" proc event)
         (tramp-flush-connection-properties proc)
         (tramp-flush-directory-properties vec ""))
-      (with-current-buffer (process-buffer proc)
-        (when (and prompt (tramp-search-regexp (regexp-quote prompt)))
-         (delete-region (point) (point-max)))))))
+      (when (buffer-live-p buf)
+       (with-current-buffer buf
+          (when (and prompt (tramp-search-regexp (regexp-quote prompt)))
+           (delete-region (point) (point-max))))))))
 
 (defun tramp-get-inode (vec)
   "Return the virtual inode number.