mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-18 13:57:43 +01:00
Merge pull request #2625 from Haselnussbomber/fix-filename-tostring-crash
Some checks are pending
Some checks are pending
Fix crash on getting the FileName of ImageNodes
This commit is contained in:
commit
bef50438f5
1 changed files with 3 additions and 9 deletions
|
|
@ -297,17 +297,11 @@ internal unsafe partial class ImageNodeTree : ResNodeTree
|
|||
}
|
||||
|
||||
this.TexType = asset->AtkTexture.TextureType;
|
||||
this.Texture = asset->AtkTexture.IsTextureReady() ? asset->AtkTexture.GetKernelTexture() : null;
|
||||
|
||||
if (this.TexType == Resource)
|
||||
if (this.TexType == Resource && asset->AtkTexture.Resource != null && asset->AtkTexture.Resource->TexFileResourceHandle != null)
|
||||
{
|
||||
var resource = asset->AtkTexture.Resource;
|
||||
this.Texture = resource->KernelTextureObject;
|
||||
this.Path = Marshal.PtrToStringAnsi(new(resource->TexFileResourceHandle->ResourceHandle.FileName.BufferPtr));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Texture = this.TexType == KernelTexture ? asset->AtkTexture.KernelTexture : null;
|
||||
this.Path = null;
|
||||
this.Path = asset->AtkTexture.Resource->TexFileResourceHandle->ResourceHandle.FileName.ToString();
|
||||
}
|
||||
|
||||
this.HiRes = this.Path?.Contains("_hr1") ?? false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue