From 671560a844281960e9e5ed87b7def95274280606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20ASLIT=C3=9CRK?= Date: Sat, 20 Jun 2020 22:44:54 +0300 Subject: [PATCH] LibGUI: Bug fix on GUI::Image when image is nullptr This bug cause to FilePicker crash when second image selected for preview. FilePicker sets bitmap to "nullptr" clear preview. --- Libraries/LibGUI/Image.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibGUI/Image.cpp b/Libraries/LibGUI/Image.cpp index 14ce0df59d7..097e42a9832 100644 --- a/Libraries/LibGUI/Image.cpp +++ b/Libraries/LibGUI/Image.cpp @@ -53,7 +53,7 @@ void Image::set_bitmap(const Gfx::Bitmap* bitmap) return; m_bitmap = bitmap; - if (m_auto_resize) + if (m_bitmap && m_auto_resize) set_preferred_size(m_bitmap->width(), m_bitmap->height()); update();