X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7fff16b863c4fb4c92d44d08e91b31e835c904d0..88932ec82d048d006cdc81bd309f5e59aee799ac:/src/gtk/combobox.cpp 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; }