mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 12:20:00 +01:00
LibWeb: Verify type before casting PaintableBox to PaintableWithLines
Previously, calling `BlockContainer::paintable_with_lines()` would cast a `PaintableBox` to a `PaintableWithLines` without verifying that the cast was valid, which isn't the cast for `FieldsetPaintable`, for example. This method now returns null if it isn't poossible to cast to `PaintableWithLines`.
This commit is contained in:
parent
4f9aca4302
commit
cd0074528e
|
|
@ -23,7 +23,7 @@ BlockContainer::~BlockContainer() = default;
|
||||||
|
|
||||||
Painting::PaintableWithLines const* BlockContainer::paintable_with_lines() const
|
Painting::PaintableWithLines const* BlockContainer::paintable_with_lines() const
|
||||||
{
|
{
|
||||||
return static_cast<Painting::PaintableWithLines const*>(Box::paintable_box());
|
return as_if<Painting::PaintableWithLines>(Box::paintable_box());
|
||||||
}
|
}
|
||||||
|
|
||||||
GC::Ptr<Painting::Paintable> BlockContainer::create_paintable() const
|
GC::Ptr<Painting::Paintable> BlockContainer::create_paintable() const
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user