Skip to content

Commit

Permalink
Merge pull request #175649 from microsoft/tyriar/175519
Browse files Browse the repository at this point in the history
Fix cell access npe
  • Loading branch information
Tyriar committed Feb 28, 2023
2 parents c4b5ade + 4bc11d6 commit 4eaeb97
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ export function convertLinkRangeToBuffer(
break;
}
for (let x = 0; x < Math.min(bufferWidth, lineLength + lineOffset); x++) {
const cell = line.getCell(x)!;
const cell = line.getCell(x);
// This is unexpected but it means the character doesn't exist, so we shouldn't add to
// the offset
if (!cell) {
break;
}
const width = cell.getWidth();
if (width === 2) {
lineOffset++;
Expand Down

0 comments on commit 4eaeb97

Please sign in to comment.