From 93bba41dd5613d1b132fc202c1fa4055b972021a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adomas=20Ven=C4=8Dkauskas?= <adomas.ven@gmail.com>
Date: Tue, 15 Nov 2022 13:53:25 +0200
Subject: [PATCH] Don't throw when getting potential proxies with invalid URL

---
 chrome/content/zotero/xpcom/proxy.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

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