# HG changeset patch # User William Pitcock # Date 1190573258 18000 # Node ID 968144b94ece6ab8a91e0c3cbf2c0ce4ac79ce59 # Parent 98ba3170b2de6479e185e174e97ccabb49fa0d4c Don't crash when the skin doesn't actually exist. diff -r 98ba3170b2de -r 968144b94ece src/audacious/skin.c --- a/src/audacious/skin.c Sun Sep 23 13:42:10 2007 -0500 +++ b/src/audacious/skin.c Sun Sep 23 13:47:38 2007 -0500 @@ -309,14 +309,6 @@ width = gdk_pixbuf_get_width(pixbuf); height = gdk_pixbuf_get_height(pixbuf); - /* create the windows if they haven't been created yet, needed for bootstrapping */ - if (mainwin == NULL) - { - mainwin_create(); - equalizerwin_create(); - playlistwin_create(); - } - if (!(pixmap = gdk_pixmap_new(mainwin->window, width, height, gdk_rgb_get_visual()->depth))) { g_object_unref(pixbuf); @@ -517,6 +509,14 @@ { bmp_active_skin = skin_new(); + /* create the windows if they haven't been created yet, needed for bootstrapping */ + if (mainwin == NULL) + { + mainwin_create(); + equalizerwin_create(); + playlistwin_create(); + } + if (!bmp_active_skin_load(path)) { /* FIXME: Oddly, g_message() causes a crash if path is NULL on * Solaris (see bug #165) */ @@ -1392,9 +1392,13 @@ else cursor_gdk = gdk_cursor_new(GDK_LEFT_PTR); - gdk_window_set_cursor(mainwin->window, cursor_gdk); - gdk_window_set_cursor(playlistwin->window, cursor_gdk); - gdk_window_set_cursor(equalizerwin->window, cursor_gdk); + if (mainwin && playlistwin && equalizerwin) + { + gdk_window_set_cursor(mainwin->window, cursor_gdk); + gdk_window_set_cursor(playlistwin->window, cursor_gdk); + gdk_window_set_cursor(equalizerwin->window, cursor_gdk); + } + gdk_cursor_unref(cursor_gdk); } @@ -1422,6 +1426,9 @@ filename = find_file_recursively(path, "pledit.txt"); inifile = open_ini_file(filename); + if (!inifile) + return; + skin->colors[SKIN_PLEDIT_NORMAL] = skin_load_color(inifile, "Text", "Normal", "#2499ff"); skin->colors[SKIN_PLEDIT_CURRENT] =