summaryrefslogtreecommitdiffstats
path: root/src/file.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2009-01-04 03:14:00 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2009-01-04 03:14:00 +0000
commit6e93c33a31c6b2ce30558902e58a0b7b23213018 (patch)
tree45a82635f9c7784389937002819a617caeba5890 /src/file.cpp
parentclean up code a bit. especially remove obscure newing of a struct with C++ ob... (diff)
downloadinkscape-6e93c33a31c6b2ce30558902e58a0b7b23213018.tar.gz
inkscape-6e93c33a31c6b2ce30558902e58a0b7b23213018.zip
fix possible crash
(bzr r7072)
Diffstat (limited to 'src/file.cpp')
-rw-r--r--src/file.cpp4
1 files changed, 3 insertions, 1 deletions
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);
}