evolution r35185 - branches/gnome-2-22/widgets/misc



Author: mcrha
Date: Thu Mar 13 12:58:54 2008
New Revision: 35185
URL: http://svn.gnome.org/viewvc/evolution?rev=35185&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:
   branches/gnome-2-22/widgets/misc/ChangeLog
   branches/gnome-2-22/widgets/misc/e-attachment.c

Modified: branches/gnome-2-22/widgets/misc/e-attachment.c
==============================================================================
--- branches/gnome-2-22/widgets/misc/e-attachment.c	(original)
+++ branches/gnome-2-22/widgets/misc/e-attachment.c	Thu Mar 13 12:58:54 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]