Skip to content

Commit

Permalink
Fix crash involving line-column lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
WilsonGramer committed Jul 29, 2023
1 parent 0915ada commit f1f1786
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions website/shared/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,15 @@ export const PlaygroundRunner = forwardRef<
note.code + "\n\n"
);

let { line, col } = lookup.fromIndex(
let result = lookup.fromIndex(
note.span.start
)!;
);

if (!result) {
return null;
}

const { line, col } = result;

const start = lookup.toIndex(line, 1);

Expand Down

0 comments on commit f1f1786

Please sign in to comment.