fix(editor): block selection error when unloaded (#9511)

Closes: [BS-2305](https://linear.app/affine-design/issue/BS-2305/typeerror-thisblock-is-null)
This commit is contained in:
Saul-Mirone
2025-01-03 10:09:01 +00:00
parent ee5f13cd03
commit b17dac2201

View File

@@ -54,7 +54,9 @@ export class BlockSelection extends SignalWatcher(LitElement) {
protected override updated(_changedProperties: PropertyValues): void {
super.updated(_changedProperties);
this.style.display = this.block.selected?.is('block') ? 'block' : 'none';
if (this.block) {
this.style.display = this.block.selected?.is('block') ? 'block' : 'none';
}
}
@property({ attribute: false })