changeset 51432:6db55492aca9

* gtkutil.c (make_menu_item): Make sure we don't crash on a NULL menu item label.
author Jan Djärv <jan.h.d@swipnet.se>
date Tue, 03 Jun 2003 17:38:41 +0000
parents 5fc6a7035dd3
children 6bc01726e133
files src/ChangeLog src/gtkutil.c
diffstat 2 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Tue Jun 03 13:30:08 2003 +0000
+++ b/src/ChangeLog	Tue Jun 03 17:38:41 2003 +0000
@@ -1,3 +1,8 @@
+2003-06-03  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* gtkutil.c (make_menu_item): Make sure we don't crash on a NULL
+	menu item label.
+
 2003-06-03  Richard M. Stallman  <rms@gnu.org>
 
 	* window.c (Fwindow_edges): Doc fix.
--- a/src/gtkutil.c	Tue Jun 03 13:30:08 2003 +0000
+++ b/src/gtkutil.c	Tue Jun 03 17:38:41 2003 +0000
@@ -1249,6 +1249,12 @@
   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);