From 3612e7243a46fcda43ad22dc7e9166fe90efc1c5 Mon Sep 17 00:00:00 2001 From: johanengelen Date: Wed, 14 Jan 2009 21:10:00 +0000 Subject: [PATCH] i guess this is better but doesn't fix crash --- src/file.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/file.cpp b/src/file.cpp index 6fa5563c9..95c4d22ca 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -96,12 +96,14 @@ static void sp_file_add_recent(gchar const *uri) { GtkRecentManager *recent = gtk_recent_manager_get_default(); gchar *fn = g_filename_from_utf8(uri, -1, NULL, NULL, NULL); - gchar *uri_to_add = g_filename_to_uri(fn, NULL, NULL); - if (uri_to_add) { - gtk_recent_manager_add_item(recent, uri_to_add); + if (fn) { + gchar *uri_to_add = g_filename_to_uri(fn, NULL, NULL); + if (uri_to_add) { + gtk_recent_manager_add_item(recent, uri_to_add); + g_free(uri_to_add); + } + g_free(fn); } - g_free(uri_to_add); - g_free(fn); } -- 2.30.2