crash prevention when failing to GetContents in CardRenderer
This commit is contained in:
@@ -117,8 +117,20 @@ internal class CardRenderer(ICoreClientAPI api, Config config) : IDisposable
|
|||||||
if (heldBag == null)
|
if (heldBag == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
ItemStack[]? bagContents;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
bagContents = heldBag.GetContents(bagStack, api.World);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bagContents == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
contents = [];
|
contents = [];
|
||||||
ItemStack[] bagContents = heldBag.GetContents(bagStack, api.World);
|
|
||||||
foreach (ItemStack contentStack in bagContents)
|
foreach (ItemStack contentStack in bagContents)
|
||||||
{
|
{
|
||||||
if (contentStack == null || contentStack.StackSize <= 0)
|
if (contentStack == null || contentStack.StackSize <= 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user