Labels: high, bug, crash, menu
Description
The category click handler reads the item's metadata before verifying that the item exists.
The current order is effectively:
name = items.item_meta.display_name
followed by:
if items is None
Steps to reproduce
Click a slot for which inv.get_item(slot) returns None.
Actual behavior
The handler can throw an exception while accessing item_meta.
Expected behavior
Check that the item and its metadata exist before accessing any properties.
Labels: high, bug, crash, menu
Description
The category click handler reads the item's metadata before verifying that the item exists.
The current order is effectively:
name = items.item_meta.display_namefollowed by:
if items is NoneSteps to reproduce
Click a slot for which
inv.get_item(slot)returnsNone.Actual behavior
The handler can throw an exception while accessing
item_meta.Expected behavior
Check that the item and its metadata exist before accessing any properties.