diff options
-rw-r--r-- | libcaja-private/caja-bookmark.c | 10 | ||||
-rw-r--r-- | src/caja-bookmarks-sidebar.c | 5 |
2 files changed, 7 insertions, 8 deletions
diff --git a/libcaja-private/caja-bookmark.c b/libcaja-private/caja-bookmark.c index 501f377d..cbcec80a 100644 --- a/libcaja-private/caja-bookmark.c +++ b/libcaja-private/caja-bookmark.c @@ -274,11 +274,13 @@ char * caja_bookmark_get_uri (CajaBookmark *bookmark) { GFile *file; - char *uri; + char *uri = NULL; - file = caja_bookmark_get_location (bookmark); - uri = g_file_get_uri (file); - g_object_unref (file); + if ((file = caja_bookmark_get_location (bookmark)) != NULL) + { + uri = g_file_get_uri (file); + g_object_unref (file); + } return uri; } diff --git a/src/caja-bookmarks-sidebar.c b/src/caja-bookmarks-sidebar.c index fdff6e5d..57aa563d 100644 --- a/src/caja-bookmarks-sidebar.c +++ b/src/caja-bookmarks-sidebar.c @@ -328,10 +328,7 @@ loading_uri_callback (CajaWindowInfo *window, gtk_tree_model_get (model, &iter, BOOKMARKS_SIDEBAR_COLUMN_BOOKMARK, &bookmark, -1); - - uri = caja_bookmark_get_uri (bookmark); - - if (uri != NULL) + if (bookmark && ((uri = caja_bookmark_get_uri (bookmark)) != NULL)) { if (strcmp (uri, location) == 0) { |