mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-23 08:59:17 +01:00
Don't crash when selecting currencies
Catch error when loading an invalid texture.
This commit is contained in:
parent
03e4a4d25c
commit
a80426bd0e
1 changed files with 14 additions and 5 deletions
|
|
@ -142,11 +142,20 @@ namespace Dalamud.Interface
|
||||||
{
|
{
|
||||||
this.selectedItemIndex = i;
|
this.selectedItemIndex = i;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
var iconTex = this.data.GetIcon(this.searchTask.Result[i].Icon);
|
var iconTex = this.data.GetIcon(this.searchTask.Result[i].Icon);
|
||||||
this.selectedItemTex?.Dispose();
|
this.selectedItemTex?.Dispose();
|
||||||
|
|
||||||
this.selectedItemTex =
|
this.selectedItemTex =
|
||||||
this.builder.LoadImageRaw(iconTex.GetRgbaImageData(), iconTex.Header.Width,
|
this.builder.LoadImageRaw(iconTex.GetRgbaImageData(), iconTex.Header.Width,
|
||||||
iconTex.Header.Height, 4);
|
iconTex.Header.Height, 4);
|
||||||
|
} catch (Exception ex)
|
||||||
|
{
|
||||||
|
Log.Debug("Failed loading item texture");
|
||||||
|
this.selectedItemTex?.Dispose();
|
||||||
|
this.selectedItemTex = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue