@colyseus/schema 4.0.10 → 4.0.11

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/index.cjs CHANGED
@@ -5187,7 +5187,7 @@ class StateCallbackStrategy {
5187
5187
  const removeOnAdd = () => removeHandler();
5188
5188
  const collection = instance[propertyName];
5189
5189
  // Collection not available yet. Listen for its availability before attaching the handler.
5190
- if (collection === null || collection === undefined) {
5190
+ if (!collection || collection[$refId] === undefined) {
5191
5191
  removeHandler = this.addCallback(instance[$refId], propertyName, (value, _) => {
5192
5192
  if (value !== null && value !== undefined) {
5193
5193
  removeHandler = this.addCallback(value[$refId], operation, handler);