Handle when foldItem()
tries to modify an item without a upd object
This commit is contained in:
parent
867b1ea50f
commit
6cda845f1f
@ -340,8 +340,8 @@ export class InventoryController
|
||||
): IItemEventRouterResponse
|
||||
{
|
||||
const inventoryItems = this.inventoryHelper.getOwnerInventoryItems(body, sessionID);
|
||||
const sourceItem = inventoryItems.from.find(item => item._id == body.item);
|
||||
const destinationItem = inventoryItems.to.find(item => item._id == body.with);
|
||||
const sourceItem = inventoryItems.from.find((item) => item._id == body.item);
|
||||
const destinationItem = inventoryItems.to.find((item) => item._id == body.with);
|
||||
|
||||
if (sourceItem === null)
|
||||
{
|
||||
@ -458,6 +458,11 @@ export class InventoryController
|
||||
{
|
||||
if (item._id && item._id === body.item)
|
||||
{
|
||||
if (!item.upd)
|
||||
{
|
||||
item.upd = {};
|
||||
}
|
||||
|
||||
item.upd.Foldable = { Folded: body.value };
|
||||
return this.eventOutputHolder.getOutput(sessionID);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user