LibWeb: Don't crash when modifying detached progress element attributes

This commit is contained in:
Tim Ledbetter 2024-03-18 06:13:01 +00:00 committed by Andreas Kling
parent 8057542dea
commit e795c24fdd
Notes: sideshowbarker 2024-07-17 04:09:56 +09:00
3 changed files with 13 additions and 1 deletions

View file

@ -114,7 +114,8 @@ void HTMLProgressElement::create_shadow_tree_if_needed()
void HTMLProgressElement::update_progress_value_element()
{
MUST(m_progress_value_element->style_for_bindings()->set_property(CSS::PropertyID::Width, MUST(String::formatted("{}%", position() * 100))));
if (m_progress_value_element)
MUST(m_progress_value_element->style_for_bindings()->set_property(CSS::PropertyID::Width, MUST(String::formatted("{}%", position() * 100))));
}
}