Schema crashes on removing item from map
serjek opened this issue · comments
serjek commented
Following thrown when server removes item from map:
TypeError: item1.onRemove is not a function. (In 'item1.onRemove()', 'item1.onRemove' is undefined)
Specifically it crashes at Schema 678. Temp workaround is to add null check for item.onRemove at 677: if (item && isSchemaType && item.onRemove != null)
although it does not fix the root of the problem, just removes the crash.
Endel Dreyer commented
Thanks for reporting @serjek, this is actually how the JavaScript is implemented: https://github.com/colyseus/schema/blob/master/src/Schema.ts#L340-L346