# HG changeset patch # User Matti Hamalainen # Date 1209519481 -10800 # Node ID 8465e73d55847f9abd174e2512078a0b593114b6 # Parent 16466c2624b22c586620b8cc0e0807b16eab63ca Check for NULL playlist pointer in configuration saving. This situation may occur if the process is interrupted by a signal. diff -r 16466c2624b2 -r 8465e73d5584 src/audacious/audconfig.c --- a/src/audacious/audconfig.c Wed Apr 30 04:35:59 2008 +0300 +++ b/src/audacious/audconfig.c Wed Apr 30 04:38:01 2008 +0300 @@ -632,8 +632,10 @@ /* This is a bit lame .. it'll end up being written twice, * could do with being done a bit neater. -larne */ - cfg_db_set_int(db, NULL, "playlist_position", + if (playlist) { + cfg_db_set_int(db, NULL, "playlist_position", playlist_get_position(playlist)); + } hook_call("config save", db); @@ -747,7 +749,9 @@ cfg_db_close(db); - playlist_save(playlist, aud_paths[BMP_PATH_PLAYLIST_FILE]); + if (!playlist_save(playlist, aud_paths[BMP_PATH_PLAYLIST_FILE])) { + g_warning("Could not save main playlist\n"); + } /* Save extra playlists that were loaded from PLAYLISTS_DIR */ saved = NULL;