From a54b91f704c9851043270852b3c6e4d078607a91 Mon Sep 17 00:00:00 2001 From: Yeicor <4929005+Yeicor@users.noreply.github.com> Date: Sat, 2 Aug 2025 14:06:21 +0200 Subject: [PATCH] Fix demo --- frontend/misc/network.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/misc/network.ts b/frontend/misc/network.ts index 42d0572..7db11f7 100644 --- a/frontend/misc/network.ts +++ b/frontend/misc/network.ts @@ -56,8 +56,13 @@ export class NetworkManager extends EventTarget { name = name.replace('.glb', '').replace('.gltf', ''); } else { // If there is a #name parameter in the URL, use it as the name - let urlObj = new URL(url); - let hashParams = new URLSearchParams(urlObj.hash.slice(1)); + let hashParams: URLSearchParams + try { + let urlObj = new URL(url); + hashParams = new URLSearchParams(urlObj.hash.slice(1)); + } catch (e) { + hashParams = new URLSearchParams(); + } if (hashParams.has("name")) { name = hashParams.get("name") || `unknown-${Math.random()}`; } else { // Default to the last part of the URL as the "name" of the model