fix(editor): block can be null in widget (#10959)

Closes: [BS-2826](https://linear.app/affine-design/issue/BS-2826/typeerror-thisblock-is-null)
This commit is contained in:
Saul-Mirone
2025-03-18 10:58:19 +00:00
parent b7ab49a263
commit 321e3449ec
17 changed files with 118 additions and 55 deletions

View File

@@ -28,7 +28,7 @@ export class WidgetComponent<
};
get block() {
return this.std.view.getBlock(this.model.id) as B;
return this.std.view.getBlock(this.model.id) as B | null;
}
get doc() {