mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:57:43 +00:00
LibWeb: Fix null pointer dereference in DOM::Node::remove()
Instead of blindly dereferencing m_registered_observer_list, just use the add_registered_observer() helper. Fixes #22005
This commit is contained in:
parent
7320fdc1f5
commit
cc9de38ea4
3 changed files with 15 additions and 1 deletions
|
@ -0,0 +1,13 @@
|
|||
<body>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
let observer = new MutationObserver(function() {});
|
||||
observer.observe(document.body, { attributes: true, childList: true, subtree: true });
|
||||
|
||||
let div = document.createElement("div");
|
||||
document.body.appendChild(div);
|
||||
div.remove();
|
||||
println("PASS! (Didn't crash)");
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue