From 210b8a1adf47f7c9edd2b817ef233f7403d1c07f Mon Sep 17 00:00:00 2001 From: johanengelen Date: Sun, 4 Jan 2009 03:14:00 +0000 Subject: [PATCH] fix possible crash --- src/file.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/file.cpp b/src/file.cpp index 71a3ddd6c..6fa5563c9 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -97,7 +97,9 @@ 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); - gtk_recent_manager_add_item(recent, uri_to_add); + if (uri_to_add) { + gtk_recent_manager_add_item(recent, uri_to_add); + } g_free(uri_to_add); g_free(fn); } -- 2.30.2