Fixed crash when opening inventory.