Skip to content

Commit 941f3a2

Browse files
committed
fix: null check
1 parent a13c93e commit 941f3a2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/y-socket-io/y-socket-io.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,9 +470,11 @@ export class YSocketIO {
470470
if (msg.length === 0) continue
471471
Y.applyUpdate(existDoc.ydoc, msg)
472472
}
473-
for (const msg of awareness) {
474-
if (msg.length === 0) continue
475-
AwarenessProtocol.applyAwarenessUpdate(existDoc.awareness, msg, null)
473+
if (existDoc.awareness) {
474+
for (const msg of awareness) {
475+
if (msg.length === 0) continue
476+
AwarenessProtocol.applyAwarenessUpdate(existDoc.awareness, msg, null)
477+
}
476478
}
477479
})
478480
}

0 commit comments

Comments
 (0)