@colyseus/schema 3.0.50 → 3.0.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.js +6 -1
- package/build/cjs/index.js.map +1 -1
- package/build/esm/index.mjs +6 -1
- package/build/esm/index.mjs.map +1 -1
- package/build/umd/index.js +6 -1
- package/lib/encoder/EncodeOperation.js +6 -1
- package/lib/encoder/EncodeOperation.js.map +1 -1
- package/package.json +1 -1
- package/src/encoder/EncodeOperation.ts +6 -1
package/build/esm/index.mjs
CHANGED
|
@@ -1586,7 +1586,12 @@ const encodeArray = function (encoder, bytes, changeTree, field, operation, it,
|
|
|
1586
1586
|
const useOperationByRefId = hasView && changeTree.isFiltered && (typeof (changeTree.getType(field)) !== "string");
|
|
1587
1587
|
let refOrIndex;
|
|
1588
1588
|
if (useOperationByRefId) {
|
|
1589
|
-
|
|
1589
|
+
const item = ref['tmpItems'][field];
|
|
1590
|
+
// Skip encoding if item is undefined (e.g. when clear() is called)
|
|
1591
|
+
if (!item) {
|
|
1592
|
+
return;
|
|
1593
|
+
}
|
|
1594
|
+
refOrIndex = item[$changes].refId;
|
|
1590
1595
|
if (operation === OPERATION.DELETE) {
|
|
1591
1596
|
operation = OPERATION.DELETE_BY_REFID;
|
|
1592
1597
|
}
|