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.
This commit is contained in:
Hüseyin ASLITÜRK 2020-06-20 22:44:54 +03:00 committed by Andreas Kling
parent e1bd815a6a
commit 671560a844
Notes: sideshowbarker 2024-07-19 05:29:15 +09:00

View file

@ -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();