From 5e0ee3e8d9cdb7568dce9e0758011831e9100c3a Mon Sep 17 00:00:00 2001 From: John Barlow Date: Tue, 27 Oct 2020 18:55:29 -0400 Subject: [PATCH] defensive code for when the document sometimes isn't there on server restarts. (#26) --- packages/backend/src/SocketIOConnection.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/backend/src/SocketIOConnection.ts b/packages/backend/src/SocketIOConnection.ts index 5eec34a..aaad24e 100644 --- a/packages/backend/src/SocketIOConnection.ts +++ b/packages/backend/src/SocketIOConnection.ts @@ -219,6 +219,7 @@ export default class SocketIOCollaboration { garbageCursors = (nsp: string) => { const doc = this.backend.getDocument(nsp) + if (doc == null || doc == undefined) return; if (!doc.cursors) return const namespace = this.io.of(nsp)