mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 05:04:15 +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;
|
||||
|
||||
var iconTex = this.data.GetIcon(this.searchTask.Result[i].Icon);
|
||||
this.selectedItemTex?.Dispose();
|
||||
this.selectedItemTex =
|
||||
this.builder.LoadImageRaw(iconTex.GetRgbaImageData(), iconTex.Header.Width,
|
||||
iconTex.Header.Height, 4);
|
||||
try
|
||||
{
|
||||
var iconTex = this.data.GetIcon(this.searchTask.Result[i].Icon);
|
||||
this.selectedItemTex?.Dispose();
|
||||
|
||||
this.selectedItemTex =
|
||||
this.builder.LoadImageRaw(iconTex.GetRgbaImageData(), iconTex.Header.Width,
|
||||
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