1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[spidermonkey] Check for NULL

This commit is contained in:
Witold Filipczyk 2023-11-22 20:21:26 +01:00
parent 267e25e908
commit fe90abbaec

View File

@ -156,6 +156,10 @@ forms_set_items(JSContext *ctx, JS::HandleObject hobj, void *node)
foreach (fv, vs->forms) { foreach (fv, vs->forms) {
struct form *form = find_form_by_form_view(document, fv); struct form *form = find_form_by_form_view(document, fv);
if (!form) {
continue;
}
JS::RootedObject v(ctx, get_form_object(ctx, form)); JS::RootedObject v(ctx, get_form_object(ctx, form));
JS::RootedValue ro(ctx, JS::ObjectOrNullValue(v)); JS::RootedValue ro(ctx, JS::ObjectOrNullValue(v));
JS_SetElement(ctx, hobj, counter, ro); JS_SetElement(ctx, hobj, counter, ro);