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.
This commit is contained in:
parent
33c585edd4
commit
06499a6fe6
1 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue