Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/backend
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2006-04-04 16:52:48 (GMT)
committer Carlos Garcia Campos <carlosgc@src.gnome.org>2006-04-04 16:52:48 (GMT)
commit34f87f02fa13028c10ebf54be39f7d0045040505 (patch)
treee61da9db26086859b43906fe18de3418af9bfd24 /backend
parent1ad8b6b9bd67fa4d6ea23885ab2bef25f12316c6 (diff)
Fix a crash when there isn't a default application to open an attachment
2006-04-03 Carlos Garcia Campos <carlosgc@gnome.org> * backend/ev-attachment.c: Fix a crash when there isn't a default application to open an attachment
Diffstat (limited to 'backend')
-rw-r--r--backend/ev-attachment.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/backend/ev-attachment.c b/backend/ev-attachment.c
index 9d5aaff..f0002f3 100644
--- a/backend/ev-attachment.c
+++ b/backend/ev-attachment.c
@@ -364,12 +364,24 @@ ev_attachment_open (EvAttachment *attachment,
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);