From 08f33d7e9e6d0c6c34bfb150e433930cfa1162e9 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Tue, 31 Aug 2021 11:53:42 +0800 Subject: [PATCH] Fix WebUI crash when tracker URL is invalid Closes #15391. PR #15395. --- src/webui/www/private/scripts/client.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/webui/www/private/scripts/client.js b/src/webui/www/private/scripts/client.js index 2ef2f657d..a5216b6e2 100644 --- a/src/webui/www/private/scripts/client.js +++ b/src/webui/www/private/scripts/client.js @@ -97,7 +97,12 @@ function genHash(string) { } function getTrackerHost(url) { - return new URL(url).hostname; + try { + return new URL(url).hostname; + } + catch (error) { + return url; + } } function getSyncMainDataInterval() {