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:
parent
080112eb82
commit
4ef9edbff7
1 changed files with 3 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue