Skip to content

Category click handler accesses an item before checking for None #11

Description

@CYooBin10

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions