From c317ccb3b3024c879b91671e756bdbce745cfab2 Mon Sep 17 00:00:00 2001 From: zhuxudong Date: Wed, 7 Aug 2024 11:10:39 +0800 Subject: [PATCH] refactor: delete try catch --- packages/loader/src/gltf/extensions/EXT_texture_webp.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/loader/src/gltf/extensions/EXT_texture_webp.ts b/packages/loader/src/gltf/extensions/EXT_texture_webp.ts index 1b9d7249cc..d723df0599 100644 --- a/packages/loader/src/gltf/extensions/EXT_texture_webp.ts +++ b/packages/loader/src/gltf/extensions/EXT_texture_webp.ts @@ -15,11 +15,7 @@ class EXT_texture_webp extends GLTFExtensionParser { constructor() { super(); - try { - this._supportWebP = document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp") == 0; - } catch (e) { - this._supportWebP = false; - } + this._supportWebP = document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp") == 0; } override async createAndParse(