From 6968a3b87cee46f5c5af9b46e1ef97f17133cef7 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Sun, 25 Nov 2012 02:49:42 +0000 Subject: [PATCH] fix wxBitmapComboBox Gtk-CRITICAL assertion `GTK_IS_ENTRY (entry)' failed git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73012 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/combobox.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp index bf76ed5c50..40c437fa23 100644 --- a/src/gtk/combobox.cpp +++ b/src/gtk/combobox.cpp @@ -409,10 +409,14 @@ wxSize wxComboBox::DoGetSizeFromTextSize(int xlen, int ylen) const { wxSize tsize( wxChoice::DoGetSizeFromTextSize(xlen, ylen) ); - // Add the margins we have previously set, but only the horizontal border - // as vertical one has been taken account in the prevoius call. - // Also get other GTK+ margins. - tsize.IncBy( GTKGetEntryMargins(GetEntry()).x, 0); + GtkEntry* entry = GetEntry(); + if (entry) + { + // Add the margins we have previously set, but only the horizontal border + // as vertical one has been taken account in the previous call. + // Also get other GTK+ margins. + tsize.IncBy(GTKGetEntryMargins(entry).x, 0); + } return tsize; } -- 2.47.2