1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:17:44 +00:00

LibCore: Verify type of value in enum property setter

This commit is contained in:
Vyacheslav Pukhanov 2021-03-18 20:01:09 +03:00 committed by Andreas Kling
parent 4915cf5ab0
commit a078733865

View file

@ -321,6 +321,8 @@ T* Object::find_descendant_of_type_named(const String& name) requires IsBaseOf<O
EnumType enum_value; \
String string_value; \
} options[] = { __VA_ARGS__ }; \
if (!value.is_string()) \
return false; \
auto string_value = value.as_string(); \
for (size_t i = 0; i < array_size(options); ++i) { \
auto& option = options[i]; \