From 33c2de748a15e93d563e06e43aef368d5c04c634 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Sat, 18 Jun 2022 08:09:25 -0700 Subject: [PATCH] Avoid assertions from wxGtkImage when bitmap is missing See #22550 --- src/gtk/image_gtk.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gtk/image_gtk.cpp b/src/gtk/image_gtk.cpp index c6568ce18b..d046c16632 100644 --- a/src/gtk/image_gtk.cpp +++ b/src/gtk/image_gtk.cpp @@ -130,11 +130,16 @@ static gboolean wxGtkImageDraw(GtkWidget* widget, GdkEventExpose* event) #endif const wxBitmap bitmap(image->m_provider->Get(scale)); -#ifndef __WXGTK3__ - // We rely on GTK to draw default disabled images if (!bitmap.IsOk()) + { +#ifdef __WXGTK3__ + // Missing bitmap, just do the default + return wxGtkImageParentClass->draw(widget, cr); +#else + // We rely on GTK to draw default disabled images return wxGtkImageParentClass->expose_event(widget, event); #endif + } GtkAllocation alloc; gtk_widget_get_allocation(widget, &alloc);