aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-10-09 06:28:49 +0000
committerGuy Harris <guy@alum.mit.edu>2000-10-09 06:28:49 +0000
commitfedb22f4145e731dbad704ec33c04c4b3ecf796a (patch)
tree43ddbcb45e7b8c347e266c58ccf6ee5faf94e220
parentaa72e65a19654c37c14e86127080f7e77fafd356 (diff)
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
-rw-r--r--gtk/gui_prefs.c9
1 files changed, 8 insertions, 1 deletions
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 <gerald@zing.org>
@@ -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);