diff options
-rw-r--r-- | widgets/misc/ChangeLog | 8 | ||||
-rw-r--r-- | widgets/misc/e-attachment.c | 11 |
2 files changed, 19 insertions, 0 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog index 8714f3ff64..6186c3dbf6 100644 --- a/widgets/misc/ChangeLog +++ b/widgets/misc/ChangeLog @@ -1,5 +1,13 @@ 2008-03-13 Milan Crha <mcrha@redhat.com> + ** Fix for bug #460204 + + * e-attachment.c: (attachment_guess_mime_type): + Check whether found mime type is valid before returning it. + My thanks come to Effenberg whom helped me to debug it. + +2008-03-13 Milan Crha <mcrha@redhat.com> + ** Fix for bug #512543 * e-calendar-item.c: Get rid of ENABLE_CAIRO define. diff --git a/widgets/misc/e-attachment.c b/widgets/misc/e-attachment.c index 4bbaebd3ab..1383335499 100644 --- a/widgets/misc/e-attachment.c +++ b/widgets/misc/e-attachment.c @@ -275,6 +275,17 @@ attachment_guess_mime_type (const char *file_name) gnome_vfs_file_info_unref (info); + if (type) { + /* gnome_vfs can sometimes return invalid type, so check for it */ + CamelContentType *ctype = camel_content_type_decode (type); + + if (!ctype) { + g_free (type); + type = NULL; + } else + camel_content_type_unref (ctype); + } + return type; } |