Skip to content

Commit

Permalink
check rangeCount before getRangeAt
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchit-agarwal committed Apr 4, 2024
1 parent 1983114 commit 2d484c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/core/src/modules/cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,7 @@ export function isAllSelectedCellsInStatus(
if (!_.isEmpty(ctx.luckysheetCellUpdate)) {
const w = window.getSelection();
if (!w) return false;
if (w.rangeCount === 0) return false;
const range = w.getRangeAt(0);
if (range.collapsed === true) {
return false;
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/modules/inline-string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ export function updateInlineStringFormat(
// let s = ctx.inlineStringEditCache;
const w = window.getSelection();
if (!w) return;
if (w.rangeCount === 0) return;

const range = w.getRangeAt(0);

Expand Down

0 comments on commit 2d484c5

Please sign in to comment.