From 45412e338945c835b4f3ca6f6a8a20eefc6c4940 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Sun, 3 Nov 2024 17:14:03 +0100 Subject: [PATCH] Fix crash on desktop client --- client/render/scene_data.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/client/render/scene_data.cpp b/client/render/scene_data.cpp index 18aed772..03fe7212 100644 --- a/client/render/scene_data.cpp +++ b/client/render/scene_data.cpp @@ -470,11 +470,18 @@ public: if (it != images.end()) return it->second; - auto [image_data, mime_type] = visit_source(gltf.images[index].data); - auto image = do_load_image(physical_device, device, queue, cb_pool, image_data, srgb); + try + { + auto [image_data, mime_type] = visit_source(gltf.images[index].data); + auto image = do_load_image(physical_device, device, queue, cb_pool, image_data, srgb); - images.emplace(index, image); - return image; + images.emplace(index, image); + return image; + } + catch (...) + { + return nullptr; + } } std::vector> load_all_textures()