Code

fix possible crash
authorjohanengelen <johanengelen@users.sourceforge.net>
Sun, 4 Jan 2009 03:14:00 +0000 (03:14 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Sun, 4 Jan 2009 03:14:00 +0000 (03:14 +0000)
src/file.cpp

index 71a3ddd6cc581191634e98a8ecf7f48a58d8796e..6fa5563c927cbd9813cca857359e33484a1ba69d 100644 (file)
@@ -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);
 }