Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix: fix current render handling in desktop controller (#2067)

Wenzhao Huddbeb0227508
diff --git a/packages/ui/src/controllers/ui/ui-desktop.controller.tsx b/packages/ui/src/controllers/ui/ui-desktop.controller.tsx
index 5600105d26..419e2f52cc 100644
--- a/packages/ui/src/controllers/ui/ui-desktop.controller.tsx
+++ b/packages/ui/src/controllers/ui/ui-desktop.controller.tsx
@@ -76,6 +76,8 @@ export class DesktopUIController extends Disposable implements IDesktopUIControl
this._renderManagerService.currentRender$.subscribe((renderId) => {
if (renderId) {
const render = this._renderManagerService.getRenderById(renderId)!;
+ if (!render.unitId) return;
+
const unitType = this._instanceService.getUnitType(render.unitId);
if (unitType !== UniverInstanceType.SHEET) return;