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

@ -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;