Skip to content

Commit c7a21f2

Browse files
committed
dumpChanges: fix iterating over ChangeTree's
1 parent f34551f commit c7a21f2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@colyseus/schema",
3-
"version": "3.0.31",
3+
"version": "3.0.32",
44
"description": "Binary state serializer with delta encoding for games",
55
"bin": {
66
"schema-codegen": "./bin/schema-codegen",

src/utils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ export function dumpChanges(schema: Schema) {
2929

3030
// for (const refId in $root.changes) {
3131
$root.changes.forEach(changeTree => {
32+
// skip if ChangeTree is undefined
33+
if (changeTree === undefined) { return; }
34+
3235
const changes = changeTree.indexedOperations;
3336

3437
dump.refs.push(`refId#${changeTree.refId}`);

0 commit comments

Comments
 (0)