mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-24 05:48:59 +08:00
fix(editor): suface component can be null (#12270)
Closes: BS-3149 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Improved internal handling of surface components across various tools, resulting in safer and more consistent access patterns. - Enhanced code maintainability and reliability without altering any visible features or user workflows. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -312,7 +312,8 @@ export class MindMapDragExtension extends InteractivityExtension {
|
||||
mindmapNode: MindmapNode,
|
||||
pos: { x: number; y: number }
|
||||
) {
|
||||
const surfaceBlock = this.gfx.surfaceComponent as SurfaceBlockComponent;
|
||||
const surfaceBlock = this.gfx
|
||||
.surfaceComponent as SurfaceBlockComponent | null;
|
||||
const renderer = surfaceBlock?.renderer;
|
||||
const indicatorOverlay = this._indicatorOverlay;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user