summaryrefslogtreecommitdiff
path: root/libcaja-private/caja-bookmark.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2022-07-29 22:55:00 +0200
committerLuke from DC <[email protected]>2022-08-04 18:48:53 +0000
commit8936a1bbf95bc0ecfb9c7223435b5e7755aa96c7 (patch)
treebb7fc1fdb5ccf603da97f42cbd9d70d808653fe1 /libcaja-private/caja-bookmark.c
parent6d5400b77dab6d8c665575438dc0fd5d07b5370b (diff)
downloadcaja-8936a1bbf95bc0ecfb9c7223435b5e7755aa96c7.tar.bz2
caja-8936a1bbf95bc0ecfb9c7223435b5e7755aa96c7.tar.xz
caja-bookmark: 'caja_bookmark_get_uri (CajaBookmark *)' may return NULL
Diffstat (limited to 'libcaja-private/caja-bookmark.c')
-rw-r--r--libcaja-private/caja-bookmark.c10
1 files changed, 6 insertions, 4 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;
}