Skip to content

Commit

Permalink
fix loading video without anno
Browse files Browse the repository at this point in the history
  • Loading branch information
hxhxhx88 committed Mar 26, 2024
1 parent 5c8dda3 commit 831a67b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions app/yjs-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 831a67b

Please sign in to comment.