1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-28 07:45:00 +00:00

Make url-tramp-convert-tramp-to-url more robust

* lisp/url/url-tramp.el (url-tramp-convert-tramp-to-url):
Prevent errors from not existing Tramp methods.
This commit is contained in:
Michael Albinus 2022-06-24 18:05:54 +02:00
parent de0b7af169
commit c7f141d678

View File

@ -62,7 +62,8 @@ In case URL is not convertible, nil is returned."
(defun url-tramp-convert-tramp-to-url (file)
"Convert FILE, a Tramp file name, to a URL.
In case FILE is not convertible, nil is returned."
(let* ((obj (and (tramp-tramp-file-p file) (tramp-dissect-file-name file)))
(let* ((obj (and (tramp-tramp-file-p file)
(ignore-errors (tramp-dissect-file-name file))))
(port
(and obj (stringp (tramp-file-name-port obj))
(string-to-number (tramp-file-name-port obj)))))