Fixed a crash in the inventory [STABLE]