Skip to content

Commit 9e4f5b7

Browse files
committed
Callbacks: fix addCallbackOrWaitCollectionAvailable() when providing concrete class
1 parent 18a507c commit 9e4f5b7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
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": "4.0.10",
3+
"version": "4.0.11",
44
"description": "Binary state serializer with delta encoding for games",
55
"type": "module",
66
"bin": {

src/decoder/strategy/Callbacks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export class StateCallbackStrategy<TState extends IRef> {
8585
const collection = (instance as any)[propertyName] as TReturn;
8686

8787
// Collection not available yet. Listen for its availability before attaching the handler.
88-
if (collection === null || collection === undefined) {
88+
if (!collection || collection[$refId] === undefined) {
8989
removeHandler = this.addCallback(
9090
instance[$refId],
9191
propertyName,

0 commit comments

Comments
 (0)