diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2019-06-15 12:19:01 +0200 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2019-06-15 12:19:01 +0200 |
commit | 06499a6fe60160743eebf4413f99b13d1fd5cff0 (patch) | |
tree | 35214202da3668c85c90821fa4b112664b681884 | |
parent | 33c585edd4e228ea24f0d3924571c7d950079073 (diff) | |
download | emacs-06499a6fe60160743eebf4413f99b13d1fd5cff0.tar.gz |
Make url-tramp more robust
* lisp/url/url-tramp.el (url-tramp-convert-url-to-tramp)
(url-tramp-convert-tramp-to-url): Check, that obj is non-nil.
-rw-r--r-- | lisp/url/url-tramp.el | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/url/url-tramp.el b/lisp/url/url-tramp.el index 305635c8d38..f4ec8226511 100644 --- a/lisp/url/url-tramp.el +++ b/lisp/url/url-tramp.el @@ -42,9 +42,9 @@ If URL contains a password, it will be added to the `password-data' cache. In case URL is not convertible, nil is returned." (let* ((obj (url-generic-parse-url (and (stringp url) url))) (port - (and (natnump (url-portspec obj)) + (and obj (natnump (url-portspec obj)) (number-to-string (url-portspec obj))))) - (when (member (url-type obj) url-tramp-protocols) + (when (and obj (member (url-type obj) url-tramp-protocols)) (when (url-password obj) (password-cache-add (tramp-make-tramp-file-name @@ -60,9 +60,9 @@ In case URL is not convertible, nil is returned." In case FILE is not convertible, nil is returned." (let* ((obj (ignore-errors (tramp-dissect-file-name file))) (port - (and (stringp (tramp-file-name-port obj)) + (and obj (stringp (tramp-file-name-port obj)) (string-to-number (tramp-file-name-port obj))))) - (when (member (tramp-file-name-method obj) url-tramp-protocols) + (when (and obj (member (tramp-file-name-method obj) url-tramp-protocols)) (url-recreate-url (url-parse-make-urlobj (tramp-file-name-method obj) |