Index: ChangeLog =================================================================== RCS file: /cvs/gnome/evince/ChangeLog,v retrieving revision 1.798 diff -u -u -r1.798 ChangeLog --- ChangeLog 3 Apr 2006 09:37:03 -0000 1.798 +++ ChangeLog 3 Apr 2006 18:54:38 -0000 @@ -1,5 +1,12 @@ 2006-04-03 Carlos Garcia Campos + * backend/ev-attachment.c: + + Fix a crash when there isn't a default application to open an + attachment + +2006-04-03 Carlos Garcia Campos + * backend/ev-attachment.[ch]: * shell/ev-attachment-bar.[ch]: Index: backend/ev-attachment.c =================================================================== RCS file: /cvs/gnome/evince/backend/ev-attachment.c,v retrieving revision 1.1 diff -u -u -r1.1 ev-attachment.c --- backend/ev-attachment.c 3 Apr 2006 09:37:03 -0000 1.1 +++ backend/ev-attachment.c 3 Apr 2006 18:54:38 -0000 @@ -364,12 +364,24 @@ GError **error) { - gboolean retval = FALSE; + gboolean retval = FALSE; + GnomeVFSMimeApplication *default_app = NULL; if (!attachment->priv->app) - attachment->priv->app = - gnome_vfs_mime_get_default_application (attachment->priv->mime_type); + default_app = gnome_vfs_mime_get_default_application (attachment->priv->mime_type); + if (!default_app) { + g_set_error (error, + EV_ATTACHMENT_ERROR, + 0, + _("Couldn't open attachment '%s'"), + attachment->priv->name); + + return FALSE; + } + + attachment->priv->app = default_app; + if (attachment->priv->tmp_uri && g_file_test (attachment->priv->tmp_uri, G_FILE_TEST_EXISTS)) { retval = ev_attachment_launch_app (attachment, error);