From bca2d063bb8fe763bfc8bfd4e14c210dab2986ba Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Sun, 26 Nov 2017 00:00:44 -0800 Subject: [PATCH] Avoid using NULL style provider Fixes assertions with wxNotebook --- src/gtk/window.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 241c3db820..5b1b0605ac 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -4690,9 +4690,12 @@ void wxWindowGTK::DoApplyWidgetStyle(GtkRcStyle *style) void wxWindowGTK::GTKApplyStyle(GtkWidget* widget, GtkRcStyle* WXUNUSED_IN_GTK3(style)) { #ifdef __WXGTK3__ - GtkStyleContext* context = gtk_widget_get_style_context(widget); - gtk_style_context_add_provider(context, - m_styleProvider, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + if (m_styleProvider) + { + GtkStyleContext* context = gtk_widget_get_style_context(widget); + gtk_style_context_add_provider(context, + m_styleProvider, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + } #else gtk_widget_modify_style(widget, style); #endif