LibWeb/Editing: Handle no active range in queryCommandState

Fixes a crash when this is invoked if no range is active for the
document.
This commit is contained in:
Shannon Booth 2025-05-25 12:26:22 +12:00 committed by Jelle Raaijmakers
commit 556acd82ee
Notes: github-actions[bot] 2025-05-26 21:37:43 +00:00
3 changed files with 5 additions and 1 deletions

View file

@ -9,7 +9,7 @@
const range = document.createRange();
const selection = window.getSelection();
// println(`strikeThrough active?: ${document.queryCommandState("strikeThrough")}`);
println(`strikeThrough active?: ${document.queryCommandState("strikeThrough")}`);
range.selectNodeContents(target);
selection.removeAllRanges();
selection.addRange(range);