mate-desktop / caja

Caja, the file manager for the MATE desktop
https://mate-desktop.org/
Other
265 stars 143 forks source link

caja-bookmark: 'caja_bookmark_get_uri (CajaBookmark *)' may return NULL #1655

Closed rbuj closed 1 year ago

rbuj commented 1 year ago

When the uri is changed, caja automatically checks whether the uri exists in the sidebar to select it. It always checks in places, bookmarks, ... . If the bookmarks list is empty, then some critical error messages are obtained such as:

GLib-GIO-CRITICAL **: 08:40:56.086: g_file_get_uri: assertion 'G_IS_FILE (file)' failed

When the bookmarks list is empty, the variable bookmark is NULL: https://github.com/mate-desktop/caja/blob/141440bf89af9df9b64f77ac3a1c0fc63b768989/src/caja-bookmarks-sidebar.c#L332-L343

lukefromdc commented 1 year ago

OK, I see how this works: ifbookmark is NULL, return NULL forURI as well, so as to avoid the g_file_get_uri: assertion 'G_IS_FILE (file)' failed testing this now w an emptied bookmarks list

lukefromdc commented 1 year ago

Error messages confirmed