diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp index f18c5a7e24..c130a34285 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp @@ -950,7 +950,7 @@ static void generate_to_cpp(SourceGenerator& generator, ParameterType& parameter bool may_be_null = !optional_default_value.has_value() || parameter.type->is_nullable() || optional_default_value.value() == "null"; // Required dictionary members cannot be null. - may_be_null &= !member.required; + may_be_null &= !member.required && !member.default_value.has_value(); if (member.type->is_string() && optional && may_be_null) { dictionary_generator.append(R"~~~(