Update getMessageItemContents()
to handle when its items.data property is null
This commit is contained in:
parent
cc488477fb
commit
382cf4c785
@ -219,7 +219,12 @@ export class DialogueHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check reward count when item being moved isn't in reward list
|
// Check reward count when item being moved isn't in reward list
|
||||||
// If count is 0, it means after this move the reward array will be empty and all rewards collected
|
// If count is 0, it means after this move occurs the reward array will be empty and all rewards collected
|
||||||
|
if (!message.items.data)
|
||||||
|
{
|
||||||
|
message.items.data = [];
|
||||||
|
}
|
||||||
|
|
||||||
const rewardItemCount = message.items.data?.filter((item) => item._id !== itemId);
|
const rewardItemCount = message.items.data?.filter((item) => item._id !== itemId);
|
||||||
if (rewardItemCount.length === 0)
|
if (rewardItemCount.length === 0)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user