Don't throw when getting potential proxies with invalid URL

This commit is contained in:
Adomas Venčkauskas 2022-11-15 13:53:25 +02:00
parent ed46d8c53c
commit 93bba41dd5

View file

@ -179,8 +179,10 @@ Zotero.Proxies = new function() {
* @returns {Object} Unproxied url to proxy object * @returns {Object} Unproxied url to proxy object
*/ */
this.getPotentialProxies = function(url) { this.getPotentialProxies = function(url) {
try {
// make sure url has a trailing slash // make sure url has a trailing slash
url = new URL(url).href; url = new URL(url).href;
} catch (e) { }
var urlToProxy = {}; var urlToProxy = {};
// If it's a known proxied URL just return it // If it's a known proxied URL just return it
if (Zotero.Proxies.transparent) { if (Zotero.Proxies.transparent) {