mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:07:45 +00:00
LibCore: Verify type of value in enum property setter
This commit is contained in:
parent
4915cf5ab0
commit
a078733865
1 changed files with 2 additions and 0 deletions
|
@ -321,6 +321,8 @@ T* Object::find_descendant_of_type_named(const String& name) requires IsBaseOf<O
|
||||||
EnumType enum_value; \
|
EnumType enum_value; \
|
||||||
String string_value; \
|
String string_value; \
|
||||||
} options[] = { __VA_ARGS__ }; \
|
} options[] = { __VA_ARGS__ }; \
|
||||||
|
if (!value.is_string()) \
|
||||||
|
return false; \
|
||||||
auto string_value = value.as_string(); \
|
auto string_value = value.as_string(); \
|
||||||
for (size_t i = 0; i < array_size(options); ++i) { \
|
for (size_t i = 0; i < array_size(options); ++i) { \
|
||||||
auto& option = options[i]; \
|
auto& option = options[i]; \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue