diff --git a/app/yjs-server/src/index.ts b/app/yjs-server/src/index.ts index 4fad71f..0407bb5 100644 --- a/app/yjs-server/src/index.ts +++ b/app/yjs-server/src/index.ts @@ -65,13 +65,9 @@ setPersistence({ reject(err); return; } - if (!row) { - reject(new Error("video not found")); - return; - } - const annoJsonStr = row.anno; - if (annoJsonStr === null) { + const annoJsonStr = row?.anno; + if (!annoJsonStr) { // no annotation console.log(`initializing a new document for ${videoId}`); resolve();