From adcb132cbaa14f2bae8b8555a5091405ad7956f7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Tue, 3 Jun 2003 17:38:41 +0000 Subject: [PATCH] * gtkutil.c (make_menu_item): Make sure we don't crash on a NULL menu item label. --- src/ChangeLog | 5 +++++ src/gtkutil.c | 6 ++++++ 2 files changed, 11 insertions(+) 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); -- 2.39.2