diff options
| author | Michael Albinus | 2019-09-21 09:53:18 +0200 |
|---|---|---|
| committer | Michael Albinus | 2019-09-21 09:53:18 +0200 |
| commit | 8f5da5587f41bec80ea32c6c9c670d132c7b6a5e (patch) | |
| tree | d68f08147b2326d79930053767782a06d505787b | |
| parent | 0dd4b87e61e2d45b958b7afb888a6de5222ed172 (diff) | |
| download | emacs-8f5da5587f41bec80ea32c6c9c670d132c7b6a5e.tar.gz emacs-8f5da5587f41bec80ea32c6c9c670d132c7b6a5e.zip | |
* lisp/net/tramp.el (tramp-handle-file-modes): Check for nil file-attributes.
| -rw-r--r-- | lisp/net/tramp.el | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index b044762b70d..b17e4a787cc 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -3152,10 +3152,10 @@ User is always nil." | |||
| 3152 | 3152 | ||
| 3153 | (defun tramp-handle-file-modes (filename) | 3153 | (defun tramp-handle-file-modes (filename) |
| 3154 | "Like `file-modes' for Tramp files." | 3154 | "Like `file-modes' for Tramp files." |
| 3155 | (let ((truename (or (file-truename filename) filename))) | 3155 | ;; Starting with Emacs 25.1, `when-let' can be used. |
| 3156 | (when (file-exists-p truename) | 3156 | (let ((attrs (file-attributes (or (file-truename filename) filename)))) |
| 3157 | (tramp-mode-string-to-int | 3157 | (when attrs |
| 3158 | (tramp-compat-file-attribute-modes (file-attributes truename)))))) | 3158 | (tramp-mode-string-to-int (tramp-compat-file-attribute-modes attrs))))) |
| 3159 | 3159 | ||
| 3160 | ;; Localname manipulation functions that grok Tramp localnames... | 3160 | ;; Localname manipulation functions that grok Tramp localnames... |
| 3161 | (defun tramp-handle-file-name-as-directory (file) | 3161 | (defun tramp-handle-file-name-as-directory (file) |