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

LibWeb: Fix that empty event handlers return null instead of crashing

This commit is contained in:
davidot 2021-07-23 11:52:01 +02:00 committed by Andreas Kling
parent 080112eb82
commit 4ef9edbff7

View file

@ -1437,6 +1437,9 @@ static @fully_qualified_name@* impl_from(JS::VM& vm, JS::GlobalObject& global_ob
)~~~");
} else if (return_type.name == "EventHandler") {
scoped_generator.append(R"~~~(
if (retval.callback.is_null())
return JS::js_null();
return retval.callback.cell();
)~~~");
} else {