ExaminePlugin: Make sure widget children array index is valid
This commit is contained in:
@@ -252,20 +252,30 @@ public class ExaminePlugin extends Plugin
|
|||||||
if (WidgetInfo.EQUIPMENT.getGroupId() == widgetGroup)
|
if (WidgetInfo.EQUIPMENT.getGroupId() == widgetGroup)
|
||||||
{
|
{
|
||||||
Widget widgetItem = widget.getChild(1);
|
Widget widgetItem = widget.getChild(1);
|
||||||
quantity = widgetItem != null ? widgetItem.getItemQuantity() : 1;
|
if (widgetItem != null)
|
||||||
itemId = widgetItem.getItemId();
|
{
|
||||||
|
quantity = widgetItem.getItemQuantity();
|
||||||
|
itemId = widgetItem.getItemId();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (WidgetInfo.BANK_INVENTORY_ITEMS_CONTAINER.getGroupId() == widgetGroup)
|
else if (WidgetInfo.BANK_INVENTORY_ITEMS_CONTAINER.getGroupId() == widgetGroup)
|
||||||
{
|
{
|
||||||
Widget widgetItem = widget.getChild(pendingExamine.getActionParam());
|
Widget widgetItem = widget.getChild(pendingExamine.getActionParam());
|
||||||
quantity = widgetItem != null ? widgetItem.getItemQuantity() : 1;
|
if (widgetItem != null)
|
||||||
itemId = widgetItem.getItemId();
|
{
|
||||||
|
quantity = widgetItem.getItemQuantity();
|
||||||
|
itemId = widgetItem.getItemId();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (WidgetInfo.BANK_ITEM_CONTAINER.getGroupId() == widgetGroup)
|
else if (WidgetInfo.BANK_ITEM_CONTAINER.getGroupId() == widgetGroup)
|
||||||
{
|
{
|
||||||
Widget widgetItem = widget.getDynamicChildren()[pendingExamine.getActionParam()];
|
Widget[] children = widget.getDynamicChildren();
|
||||||
quantity = widgetItem != null ? widgetItem.getItemQuantity() : 1;
|
if (pendingExamine.getActionParam() < children.length)
|
||||||
itemId = widgetItem.getItemId();
|
{
|
||||||
|
Widget widgetItem = children[pendingExamine.getActionParam()];
|
||||||
|
quantity = widgetItem.getItemQuantity();
|
||||||
|
itemId = widgetItem.getItemId();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user