From 64d4921f3539036ff8cb4789be88c47a6087aa1f Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 3 Apr 2021 20:36:43 +0200 Subject: LibGUI: Don't try to paint items in model-less IconView :^) Fixes #6079. --- Userland/Libraries/LibGUI/IconView.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Userland') diff --git a/Userland/Libraries/LibGUI/IconView.cpp b/Userland/Libraries/LibGUI/IconView.cpp index 2e1530a279..f2abf20c85 100644 --- a/Userland/Libraries/LibGUI/IconView.cpp +++ b/Userland/Libraries/LibGUI/IconView.cpp @@ -515,6 +515,9 @@ void IconView::paint_event(PaintEvent& event) painter.fill_rect(event.rect(), fill_with_background_color() ? widget_background_color : Color::Transparent); + if (!model()) + return; + painter.translate(frame_thickness(), frame_thickness()); painter.translate(-horizontal_scrollbar().value(), -vertical_scrollbar().value()); -- cgit v1.2.3