mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
LibWeb: Protect ad-hoc scroll
against a potentially null paintable box
We perform such a check in other users of the paintable box in this file as the box may be null before layout completes. This prevents UB seen in some CI runs.
This commit is contained in:
parent
4db9996cc0
commit
4e0a926737
Notes:
sideshowbarker
2024-07-17 02:05:41 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/4e0a926737 Pull-request: https://github.com/SerenityOS/serenity/pull/21574
1 changed files with 2 additions and 1 deletions
|
@ -1924,7 +1924,8 @@ HashMap<DeprecatedFlyString, CSS::StyleProperty> const& Element::custom_properti
|
|||
void Element::scroll(double x, double y)
|
||||
{
|
||||
// AD-HOC:
|
||||
paintable_box()->scroll_by(x, y);
|
||||
if (auto* paintable_box = this->paintable_box())
|
||||
paintable_box->scroll_by(x, y);
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom-view/#dom-element-scroll
|
||||
|
|
Loading…
Reference in a new issue