From 1df2ccfb1adef1421ceeee98374a97e1e6498366 Mon Sep 17 00:00:00 2001 From: goat Date: Wed, 2 Aug 2023 18:51:23 +0200 Subject: [PATCH] fix: throw if IM is not ready --- Dalamud/Interface/Internal/TextureManager.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dalamud/Interface/Internal/TextureManager.cs b/Dalamud/Interface/Internal/TextureManager.cs index ed7065456..8f6f6b474 100644 --- a/Dalamud/Interface/Internal/TextureManager.cs +++ b/Dalamud/Interface/Internal/TextureManager.cs @@ -185,6 +185,9 @@ internal class TextureManager : IDisposable, IServiceType, ITextureSubstitutionP public IDalamudTextureWrap? GetTexture(TexFile file) { ArgumentNullException.ThrowIfNull(file); + + if (!this.im.IsReady) + throw new InvalidOperationException("Cannot create textures before scene is ready"); #pragma warning disable CS0618 return this.dataManager.GetImGuiTexture(file) as IDalamudTextureWrap;