From: Michael Albinus Date: Mon, 18 Nov 2019 14:33:21 +0000 (+0100) Subject: * lisp/net/tramp.el (tramp-handle-file-regular-p): Improve error handling. X-Git-Tag: emacs-27.0.90~577 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3cc06d1abb6587e0922a5ddc7a7febd3dd71d55a;p=emacs.git * lisp/net/tramp.el (tramp-handle-file-regular-p): Improve error handling. --- diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 99c93eaa573..cb40c71cfeb 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3306,9 +3306,13 @@ User is always nil." (defun tramp-handle-file-regular-p (filename) "Like `file-regular-p' for Tramp files." (and (file-exists-p filename) - (eq ?- - (aref (tramp-compat-file-attribute-modes (file-attributes filename)) - 0)))) + ;; Sometimes, `file-attributes' does not return a proper value + ;; even if `file-exists-p' does. + (ignore-errors + (eq ?- + (aref + (tramp-compat-file-attribute-modes (file-attributes filename)) + 0))))) (defun tramp-handle-file-remote-p (filename &optional identification connected) "Like `file-remote-p' for Tramp files."