diff options
-rw-r--r-- | Applications/QuickShow/QSWidget.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Applications/QuickShow/QSWidget.cpp b/Applications/QuickShow/QSWidget.cpp index ca8e206e77..511bf50ec7 100644 --- a/Applications/QuickShow/QSWidget.cpp +++ b/Applications/QuickShow/QSWidget.cpp @@ -49,6 +49,9 @@ void QSWidget::set_bitmap(NonnullRefPtr<Gfx::Bitmap> bitmap) void QSWidget::relayout() { + if (m_bitmap.is_null()) + return; + Gfx::Size new_size; float scale_factor = (float)m_scale / 100.0f; new_size.set_width(m_bitmap->width() * scale_factor); @@ -65,6 +68,9 @@ void QSWidget::resize_event(GUI::ResizeEvent& event) void QSWidget::paint_event(GUI::PaintEvent& event) { + if (m_bitmap.is_null()) + return; + GUI::Painter painter(*this); painter.add_clip_rect(event.rect()); |