From fedb22f4145e731dbad704ec33c04c4b3ecf796a Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 9 Oct 2000 06:28:49 +0000 Subject: It appears there's no guarantee that you'll actually get a font name from a font selection dialog box; check for a null pointer and, if so, let the user know and don't dismiss the font selection dialog. svn path=/trunk/; revision=2484 --- gtk/gui_prefs.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gtk/gui_prefs.c b/gtk/gui_prefs.c index fe14291c99..c6af8bd904 100644 --- a/gtk/gui_prefs.c +++ b/gtk/gui_prefs.c @@ -1,7 +1,7 @@ /* gui_prefs.c * Dialog box for GUI preferences * - * $Id: gui_prefs.c,v 1.19 2000/09/09 10:35:53 guy Exp $ + * $Id: gui_prefs.c,v 1.20 2000/10/09 06:28:49 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -319,6 +319,13 @@ font_browse_ok_cb(GtkWidget *w, GtkFontSelectionDialog *fs) font_name = g_strdup(gtk_font_selection_dialog_get_font_name( GTK_FONT_SELECTION_DIALOG(fs))); + if (font_name == NULL) { + /* No font was selected; let the user know, and don't let + them accept that non-font. */ + simple_dialog(ESD_TYPE_CRIT, NULL, + "You have not selected a font."); + return; + } /* Get the name that the boldface version of that font would have. */ bold_font_name = boldify(font_name); -- cgit v1.2.1