changeset 4371:20418bdce637

Fixed a segfault when trying to open fileinfo window while no file is effectively selected (e.g. when playlist is empty, for example). Patch adapted from bugzilla #216 from Federico Schwindt.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 25 Mar 2008 21:16:16 +0200
parents 8ca25aee5037
children 8e8465e9e5c7
files src/audacious/playlist.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/playlist.c	Tue Mar 25 21:02:13 2008 +0200
+++ b/src/audacious/playlist.c	Tue Mar 25 21:16:16 2008 +0200
@@ -2495,8 +2495,10 @@
 
     PLAYLIST_UNLOCK(playlist);
 
-    if (playlist->position->decoder != NULL && playlist->position->decoder->update_song_tuple != NULL &&
-        playlist->position->decoder->file_info_box == NULL && path != NULL && !vfs_is_remote(path)) {
+    if (playlist->position != NULL && playlist->position->decoder != NULL &&
+        playlist->position->decoder->update_song_tuple != NULL &&
+        playlist->position->decoder->file_info_box == NULL && path != NULL &&
+        !vfs_is_remote(path)) {
 
         fileinfo_show_editor_for_path(path, playlist->position->decoder);
         g_free(path);