summaryrefslogtreecommitdiff
path: root/src/eom-window.c
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2026-02-11 16:10:38 -0500
committerVictor Kareh <[email protected]>2026-02-11 16:10:38 -0500
commit92146417a281706d2312912c0d76c5da96ef16ea (patch)
tree3c547144b7ca77864fca4d756a4ec6bcb4c97fe7 /src/eom-window.c
parent034677b0c5bf9b37c22a6d2d52f8761c2364857d (diff)
downloadeom-add-null-checks-when-missing-attributes.tar.bz2
eom-add-null-checks-when-missing-attributes.tar.xz
Add null checks for content type with remote filesadd-null-checks-when-missing-attributes
Adds NULL checks when content-type attributes are missing from GVFS backends. This prevents a crash when opening images from remote filesystems where both standard and fast content-type attributes are missing. Fixes #366
Diffstat (limited to 'src/eom-window.c')
-rw-r--r--src/eom-window.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/eom-window.c b/src/eom-window.c
index e24738b..2a3de8e 100644
--- a/src/eom-window.c
+++ b/src/eom-window.c
@@ -748,6 +748,15 @@ add_file_to_recent_files (GFile *file)
recent_data->display_name = NULL;
recent_data->description = NULL;
recent_data->mime_type = (gchar *) eom_util_get_content_type_with_fallback (file_info);
+
+ /* mime_type is required by GTK, so bail out if we couldn't determine it */
+ if (recent_data->mime_type == NULL) {
+ g_slice_free (GtkRecentData, recent_data);
+ g_free (text_uri);
+ g_object_unref (file_info);
+ return FALSE;
+ }
+
recent_data->app_name = EOM_RECENT_FILES_APP_NAME;
recent_data->app_exec = g_strjoin(" ", g_get_prgname (), "%u", NULL);
recent_data->groups = groups;