summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-04-03 20:36:43 +0200
committerAndreas Kling <kling@serenityos.org>2021-04-03 20:36:43 +0200
commit64d4921f3539036ff8cb4789be88c47a6087aa1f (patch)
tree438952640ab8f52fbfea094090dae16218dd03a7 /Userland/Libraries
parentf1ea092d8f9fd8cf8335f6f7d0ad99834c674a72 (diff)
downloadserenity-64d4921f3539036ff8cb4789be88c47a6087aa1f.zip
LibGUI: Don't try to paint items in model-less IconView :^)
Fixes #6079.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibGUI/IconView.cpp3
1 files changed, 3 insertions, 0 deletions
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());