From: Jan Djärv Date: Tue, 3 Jun 2003 17:38:41 +0000 (+0000) Subject: * gtkutil.c (make_menu_item): Make sure we don't crash on a NULL X-Git-Tag: ttn-vms-21-2-B4~9770 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=adcb132cbaa14f2bae8b8555a5091405ad7956f7;p=emacs.git * gtkutil.c (make_menu_item): Make sure we don't crash on a NULL menu item label. --- diff --git a/src/ChangeLog b/src/ChangeLog index 9c4822ce1da..8aec4824cc4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2003-06-03 Jan Dj,Ad(Brv + + * gtkutil.c (make_menu_item): Make sure we don't crash on a NULL + menu item label. + 2003-06-03 Richard M. Stallman * window.c (Fwindow_edges): Doc fix. diff --git a/src/gtkutil.c b/src/gtkutil.c index 76d16c07695..6ad7bc24246 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -1249,6 +1249,12 @@ make_menu_item (utf8_label, utf8_key, item, group) GtkWidget *w; GtkWidget *wtoadd = 0; + /* It has been observed that some menu items have a NULL name field. + This will lead to this function being called with a NULL utf8_label. + GTK crashes on that so we set a blank label. Why there is a NULL + name remains to be investigated. */ + if (! utf8_label) utf8_label = " "; + if (utf8_key) wtoadd = make_widget_for_menu_item (utf8_label, utf8_key);