From c70b2c8f1ce4c79fb3e0e55e5c96276e4efe15cb Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Tue, 28 Feb 2012 04:40:15 +0000 Subject: [PATCH] avoid crash if IsMaximized() is called before native widget is created, fixes #14052 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70733 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/toplevel.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 97b5526870..d655fbad2e 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -1285,7 +1285,9 @@ void wxTopLevelWindowGTK::Maximize(bool maximize) bool wxTopLevelWindowGTK::IsMaximized() const { - GdkWindow* window = gtk_widget_get_window(m_widget); + GdkWindow* window = NULL; + if (m_widget) + window = gtk_widget_get_window(m_widget); return window && (gdk_window_get_state(window) & GDK_WINDOW_STATE_MAXIMIZED); } -- 2.45.2