1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:47:35 +00:00

LibWeb: Null check fonts after parsing them in CRC2D.font assignment

Fixes an issue where setting CRC2D.font to an unparseable value would
assert due to a null dereference.
This commit is contained in:
Andreas Kling 2023-08-17 08:46:38 +02:00
parent ef6a78518f
commit f34cc0b8e3
3 changed files with 14 additions and 1 deletions

View file

@ -0,0 +1,11 @@
<script src="../include.js"></script>
<script>
test(() => {
let canvas = document.createElement("canvas");
let context = canvas.getContext("2d");
context.font = '20px SerenitySans';
println(context.font);
context.font = '!!!'; // Invalid value, should be ignored.
println(context.font);
});
</script>