From 88bc0ecf85ea14eb07bdaac54e3d1303c28c6e5e Mon Sep 17 00:00:00 2001 From: zhangw Date: Mon, 18 Nov 2024 16:03:06 +0800 Subject: [PATCH] feat: update --- packages/sheets-ui/src/facade/f-range.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/sheets-ui/src/facade/f-range.ts b/packages/sheets-ui/src/facade/f-range.ts index 1e963cb676d..0475afdb2d5 100644 --- a/packages/sheets-ui/src/facade/f-range.ts +++ b/packages/sheets-ui/src/facade/f-range.ts @@ -147,8 +147,11 @@ class FRangeSheetsUIMixin extends FRange implements IFRangeSheetsUIMixin { const markSelectionService = this._injector.get(IMarkSelectionService); const id = markSelectionService.addShape({ range: this._range, style, primary }); + if (!id) { + throw new Error('Failed to highlight current range'); + } return toDisposable(() => { - id && markSelectionService.removeShape(id); + markSelectionService.removeShape(id); }); } }