diff --git a/src/Nazara/Graphics/GuillotineTextureAtlas.cpp b/src/Nazara/Graphics/GuillotineTextureAtlas.cpp index 4da4db68e..41e9d1fda 100644 --- a/src/Nazara/Graphics/GuillotineTextureAtlas.cpp +++ b/src/Nazara/Graphics/GuillotineTextureAtlas.cpp @@ -42,9 +42,16 @@ namespace Nz textureInfo.pixelFormat = PixelFormat::A8; textureInfo.type = ImageType::E2D; - std::shared_ptr newTexture = m_renderDevice.InstantiateTexture(textureInfo); - if (!newTexture) + std::shared_ptr newTexture; + try + { + newTexture = m_renderDevice.InstantiateTexture(textureInfo); + } + catch (const std::exception& e) + { + NazaraError(std::string("Failed to instantiate texture: ") + e.what()); return nullptr; + } if (oldImage) {