From d1d5602132e937e259e7e4a5fd307769100b589c Mon Sep 17 00:00:00 2001 From: FrHun <28605587+frhun@users.noreply.github.com> Date: Tue, 28 Dec 2021 19:53:41 +0100 Subject: [PATCH] LibGUI: Fix crash when clicking on small Scrollbar gutter When a Scrollbar becomes too small to display a scrubber, clicking on the empty gutter failed the VERIFY. This fixes that oversight. --- Userland/Libraries/LibGUI/Scrollbar.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Userland/Libraries/LibGUI/Scrollbar.cpp b/Userland/Libraries/LibGUI/Scrollbar.cpp index 5843649dc1..2768f4a75d 100644 --- a/Userland/Libraries/LibGUI/Scrollbar.cpp +++ b/Userland/Libraries/LibGUI/Scrollbar.cpp @@ -206,8 +206,7 @@ void Scrollbar::paint_event(PaintEvent& event) hovered_component_for_painting = Component::None; painter.fill_rect_with_dither_pattern(rect(), palette().button().lightened(1.3f), palette().button()); - if (m_gutter_click_state != GutterClickState::NotPressed && has_scrubber() && hovered_component_for_painting == Component::Gutter) { - VERIFY(!scrubber_rect().is_null()); + if (m_gutter_click_state != GutterClickState::NotPressed && has_scrubber() && !scrubber_rect().is_null() && hovered_component_for_painting == Component::Gutter) { Gfx::IntRect rect_to_fill = rect(); if (orientation() == Orientation::Vertical) { if (m_gutter_click_state == GutterClickState::BeforeScrubber) {