Silence warnings
[xboard.git] / gtk / xoptions.c
index 4f68db7..5ae8ddb 100644 (file)
@@ -279,10 +279,9 @@ ApplyFont (Option *opt, char *font)
       case ListBox:
       case Label:   w = opt->handle; break;
       case Button:  if(opt->handle) w = gtk_bin_get_child(GTK_BIN(opt->handle)); break;
-      case TextBox: w = opt->textValue; break;
+      case TextBox: w = (GtkWidget *) opt->textValue; if(!w) w = opt->handle; break;
       default: ;
     }
-printf("set font %s\n", font);
     if(w && font) SetWidgetFont(w, &font);
 }
 
@@ -616,6 +615,11 @@ AppendColorized (Option *opt, char *s, int count)
     static GtkTextIter end;
     static GtkTextTag *fgTags[8], *bgTags[8], *font, *bold, *normal, *attr = NULL;
 
+    if(!s) {
+       font = NULL;
+       return;
+    }
+
     if(!font) {
        font = gtk_text_buffer_create_tag(opt->handle, NULL, "font", appData.icsFont, NULL);
        gtk_widget_modify_base(GTK_WIDGET(opt->textValue), GTK_STATE_NORMAL, &backgroundColor);