fix: throw if IM is not ready

This commit is contained in:
goat 2023-08-02 18:51:23 +02:00
parent 2a9409a242
commit 1df2ccfb1a
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B

View file

@ -186,6 +186,9 @@ internal class TextureManager : IDisposable, IServiceType, ITextureSubstitutionP
{ {
ArgumentNullException.ThrowIfNull(file); ArgumentNullException.ThrowIfNull(file);
if (!this.im.IsReady)
throw new InvalidOperationException("Cannot create textures before scene is ready");
#pragma warning disable CS0618 #pragma warning disable CS0618
return this.dataManager.GetImGuiTexture(file) as IDalamudTextureWrap; return this.dataManager.GetImGuiTexture(file) as IDalamudTextureWrap;
#pragma warning restore CS0618 #pragma warning restore CS0618