From 99f094905e91276e3ee85b334505b3888d0f27fd Mon Sep 17 00:00:00 2001 From: Kenneth Myhra Date: Sat, 25 Feb 2023 10:16:35 +0100 Subject: BindingsGenerator: Conditionally check dictionary member is string This adds the condition member.type->is_string() to the if statement, so that we now conditionally check the dictionary member is a new string and associated with an optional constructor parameter. --- .../Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp index ca044870fc..13a6866edd 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp @@ -729,7 +729,7 @@ static void generate_to_cpp(SourceGenerator& generator, ParameterType& parameter } generate_to_cpp(dictionary_generator, member, member_property_value_name, "", member_value_name, interface, member.extended_attributes.contains("LegacyNullToEmptyString"), !member.required, member.default_value); - if (optional && interface.extended_attributes.contains("UseNewAKString")) { + if (member.type->is_string() && optional && interface.extended_attributes.contains("UseNewAKString")) { dictionary_generator.append(R"~~~( if (@member_value_name@.has_value()) @cpp_name@.@member_name@ = @member_value_name@.release_value(); -- cgit v1.2.3