Fix WebUI crash when tracker URL is invalid

Closes #15391.
PR #15395.
This commit is contained in:
Chocobo1
2021-08-31 11:53:42 +08:00
committed by GitHub
parent c034cb5985
commit 08f33d7e9e

View File

@@ -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() {