mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[quickjs] Check NULL in appendChild
This commit is contained in:
parent
33a3668f41
commit
b55792f3ed
@ -2613,14 +2613,18 @@ js_element_appendChild(JSContext *ctx, JSValueConst this_val, int argc, JSValueC
|
||||
dom_exception exc;
|
||||
|
||||
if (argc != 1) {
|
||||
return JS_NULL;
|
||||
return JS_EXCEPTION;
|
||||
}
|
||||
|
||||
if (!el) {
|
||||
return JS_EXCEPTION;
|
||||
}
|
||||
//dom_node_ref(el);
|
||||
dom_node *el2 = (dom_node *)js_getopaque_any(argv[0]);
|
||||
dom_node *el2 = NULL;
|
||||
|
||||
if (!JS_IsNull(argv[0])) {
|
||||
el2 = (dom_node *)js_getopaque_any(argv[0]);
|
||||
}
|
||||
|
||||
if (!el2) {
|
||||
//dom_node_unref(el);
|
||||
|
@ -1014,14 +1014,18 @@ js_fragment_appendChild(JSContext *ctx, JSValueConst this_val, int argc, JSValue
|
||||
dom_exception exc;
|
||||
|
||||
if (argc != 1) {
|
||||
return JS_NULL;
|
||||
return JS_EXCEPTION;
|
||||
}
|
||||
|
||||
if (!el) {
|
||||
return JS_EXCEPTION;
|
||||
}
|
||||
//dom_node_ref(el);
|
||||
dom_node *el2 = (dom_node *)(js_getopaque_fragment(argv[0], js_fragment_class_id));
|
||||
dom_node *el2 = NULL;
|
||||
|
||||
if (!JS_IsNull(argv[0])) {
|
||||
el2 = (dom_node *)(js_getopaque_fragment(argv[0], js_fragment_class_id));
|
||||
}
|
||||
|
||||
if (!el2) {
|
||||
//dom_node_unref(el);
|
||||
|
@ -1048,14 +1048,18 @@ js_text_appendChild(JSContext *ctx, JSValueConst this_val, int argc, JSValueCons
|
||||
dom_exception exc;
|
||||
|
||||
if (argc != 1) {
|
||||
return JS_NULL;
|
||||
return JS_EXCEPTION;
|
||||
}
|
||||
|
||||
if (!el) {
|
||||
return JS_EXCEPTION;
|
||||
}
|
||||
//dom_node_ref(el);
|
||||
dom_node *el2 = (dom_node *)(js_getopaque_text(argv[0], js_text_class_id));
|
||||
dom_node *el2 = NULL;
|
||||
|
||||
if (!JS_IsNull(argv[0])) {
|
||||
el2 = (dom_node *)(js_getopaque_text(argv[0], js_text_class_id));
|
||||
}
|
||||
|
||||
if (!el2) {
|
||||
//dom_node_unref(el);
|
||||
|
Loading…
Reference in New Issue
Block a user