@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/cjs/index.js
CHANGED
|
@@ -1588,7 +1588,12 @@ const encodeArray = function (encoder, bytes, changeTree, field, operation, it,
|
|
|
1588
1588
|
const useOperationByRefId = hasView && changeTree.isFiltered && (typeof (changeTree.getType(field)) !== "string");
|
|
1589
1589
|
let refOrIndex;
|
|
1590
1590
|
if (useOperationByRefId) {
|
|
1591
|
-
|
|
1591
|
+
const item = ref['tmpItems'][field];
|
|
1592
|
+
// Skip encoding if item is undefined (e.g. when clear() is called)
|
|
1593
|
+
if (!item) {
|
|
1594
|
+
return;
|
|
1595
|
+
}
|
|
1596
|
+
refOrIndex = item[$changes].refId;
|
|
1592
1597
|
if (operation === exports.OPERATION.DELETE) {
|
|
1593
1598
|
operation = exports.OPERATION.DELETE_BY_REFID;
|
|
1594
1599
|
}
|