if (!g_desktop_app_info_ensure_saved (info, error))
return FALSE;
+ if (!info->desktop_id)
+ {
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Application information lacks an identifier"));
+ return FALSE;
+ }
+
/* both add support for the content type and set as last used */
return update_mimeapps_list (info->desktop_id, content_type,
UPDATE_MIME_SET_NON_DEFAULT |
GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
if (!g_desktop_app_info_ensure_saved (info, error))
- return FALSE;
-
+ return FALSE;
+
+ if (!info->desktop_id)
+ {
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Application information lacks an identifier"));
+ return FALSE;
+ }
+
return update_mimeapps_list (info->desktop_id, content_type,
UPDATE_MIME_SET_DEFAULT,
error);