0
0
mirror of https://github.com/rkd77/elinks.git synced 2025-06-30 22:19:29 -04:00

[mujs] Check NULL in element.removeChild

This commit is contained in:
Witold Filipczyk 2024-11-06 15:27:21 +01:00
parent 1d6fe91858
commit bb9f95876e

View File

@ -3187,6 +3187,11 @@ mjs_element_removeChild(js_State *J)
struct ecmascript_interpreter *interpreter = (struct ecmascript_interpreter *)js_getcontext(J);
dom_node *el = (dom_node *)(mjs_getprivate(J, 0));
dom_node *el2 = (dom_node *)(mjs_getprivate(J, 1));
if (!el2) {
js_pushnull(J);
return;
}
dom_exception exc;
dom_node *spare;
exc = dom_node_remove_child(el, el2, &spare);