Commit 8f5da558 authored by Michael Albinus's avatar Michael Albinus

* lisp/net/tramp.el (tramp-handle-file-modes): Check for nil file-attributes.

parent 0dd4b87e
Pipeline #3230 passed with stage
in 68 minutes and 51 seconds
......@@ -3152,10 +3152,10 @@ User is always nil."
(defun tramp-handle-file-modes (filename)
"Like `file-modes' for Tramp files."
(let ((truename (or (file-truename filename) filename)))
(when (file-exists-p truename)
(tramp-compat-file-attribute-modes (file-attributes truename))))))
;; Starting with Emacs 25.1, `when-let' can be used.
(let ((attrs (file-attributes (or (file-truename filename) filename))))
(when attrs
(tramp-mode-string-to-int (tramp-compat-file-attribute-modes attrs)))))
;; Localname manipulation functions that grok Tramp localnames...
(defun tramp-handle-file-name-as-directory (file)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment