From 96ed2e65d95d5a08e772c00e251a9ad94fcd16f5 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Thu, 8 Nov 2012 20:48:38 +0000 Subject: Fix crash when fallback font is not set and NetSurf was unable to find anything suitable on startup. --- amiga/gui_options.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/amiga/gui_options.c b/amiga/gui_options.c index 5297a4e0c..71bacba2a 100755 --- a/amiga/gui_options.c +++ b/amiga/gui_options.c @@ -1619,16 +1619,16 @@ void ami_gui_opts_use(bool save) nsoption_set_charp(font_fantasy, (char *)strdup((char *)tattr->ta_Name)); GetAttr(GETFONT_TextAttr,gow->objects[GID_OPTS_FONT_UNICODE],(ULONG *)&data); - tattr = (struct TextAttr *)data; - - if(dot = strrchr(tattr->ta_Name,'.')) *dot = '\0'; + if(tattr = (struct TextAttr *)data) { + if(dot = strrchr(tattr->ta_Name,'.')) *dot = '\0'; - if(strcmp(tattr->ta_Name, nsoption_charp(font_unicode)) != 0) { - rescan_fonts = true; + if(strcmp(tattr->ta_Name, nsoption_charp(font_unicode)) != 0) { + rescan_fonts = true; + } + + nsoption_set_charp(font_unicode, (char *)strdup((char *)tattr->ta_Name)); } - - nsoption_set_charp(font_unicode, (char *)strdup((char *)tattr->ta_Name)); - + GetAttr(CHOOSER_Selected,gow->objects[GID_OPTS_FONT_DEFAULT],(ULONG *)&nsoption_int(font_default)); nsoption_set_int(font_default, nsoption_int(font_default) + PLOT_FONT_FAMILY_SANS_SERIF); -- cgit v1.2.3