From 831a67b4966a1850d1e26f96796f41a10de54cb1 Mon Sep 17 00:00:00 2001 From: Xu Han Date: Tue, 26 Mar 2024 21:35:49 +0800 Subject: [PATCH] fix loading video without anno --- app/yjs-server/src/index.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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();