evolution r35184 - trunk/widgets/misc



Author: mcrha
Date: Thu Mar 13 12:58:32 2008
New Revision: 35184
URL: http://svn.gnome.org/viewvc/evolution?rev=35184&view=rev

Log:
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.



Modified:
   trunk/widgets/misc/ChangeLog
   trunk/widgets/misc/e-attachment.c

Modified: trunk/widgets/misc/e-attachment.c
==============================================================================
--- trunk/widgets/misc/e-attachment.c	(original)
+++ trunk/widgets/misc/e-attachment.c	Thu Mar 13 12:58:32 2008
@@ -275,6 +275,17 @@
 
 	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;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]