From af5950c1087a01a412fd6f1384a74fdd8a402908 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Wed, 29 Apr 2020 07:35:44 -0700 Subject: [PATCH] Avoid Gtk-CRITICAL with GTK3 when calling SetFont() before Create() --- src/gtk/control.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gtk/control.cpp b/src/gtk/control.cpp index 7aab1a03e5..f4a25ea146 100644 --- a/src/gtk/control.cpp +++ b/src/gtk/control.cpp @@ -60,7 +60,7 @@ bool wxControl::Create( wxWindow *parent, bool wxControl::SetFont(const wxFont& font) { const bool changed = base_type::SetFont(font); - if (changed && !gtk_widget_get_realized(m_widget) && gtk_check_version(3,5,0)) + if (changed && m_widget && !gtk_widget_get_realized(m_widget) && gtk_check_version(3,5,0)) { // GTK defers sending "style-updated" until widget is realized, but // GetBestSize() won't compute correct result until the signal is sent,