changeset 4051:c07a3723777c

Prevent segfault when adding M3U playlists with URIs. Needs a cleaner solutions later.
author Christian Birchinger <joker@netswarm.net>
date Sat, 01 Dec 2007 20:51:47 +0100
parents 6981113f9848
children b0429a649a84
files src/audacious/tuple_formatter.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/tuple_formatter.c	Sat Dec 01 15:30:27 2007 +0100
+++ b/src/audacious/tuple_formatter.c	Sat Dec 01 20:51:47 2007 +0100
@@ -598,7 +598,7 @@
 
     if(!rv || !strcmp(rv, "")) {
         const gchar *file_name = tuple_get_string(tuple, FIELD_FILE_NAME, NULL);
-        gchar *realfn = g_filename_from_uri(file_name, NULL, NULL);
+        gchar *realfn = file_name != NULL ? g_filename_from_uri(file_name, NULL, NULL) : g_strdup("<unknown>");
 
         g_free(rv);
         rv = str_to_utf8(realfn ? realfn : file_name);