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.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
feat: return unrecognized for non-existing unit
Wenzhao Hu0c2527a6e77c
diff --git a/packages/core/src/services/instance/instance.service.ts b/packages/core/src/services/instance/instance.service.tsindex 2ecfb0f534..e3efed9055 100644--- a/packages/core/src/services/instance/instance.service.ts+++ b/packages/core/src/services/instance/instance.service.ts@@ -274,7 +274,7 @@ export class UniverInstanceService extends Disposable implements IUniverInstancegetUnitType(unitId: string): UniverInstanceType {const result = this._getUnitById(unitId);- if (!result) throw new Error(`[UniverInstanceService]: No document with unitId ${unitId}`);+ if (!result) return UniverInstanceType.UNRECOGNIZED;return result[1];}