Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--libdocument/ev-document-factory.c9
2 files changed, 17 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 782e3dc..6f6fa17 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-07-20 Carlos Garcia Campos <carlosgc@gnome.org>
+
+ * libdocument/ev-document-factory.c: (get_mime_type_from_data),
+ (get_document_from_uri):
+
+ Make sure we always return a valid error struct when
+ get_document_from_uri fails. Fixes nautilus crash, see bug
+ #542548.
+
2008-07-15 Darren Kenny <darren.kenny@sun.com>
* libdocument/ev-transition-effect.c
diff --git a/libdocument/ev-document-factory.c b/libdocument/ev-document-factory.c
index 64eaaba..e7c76b9 100644
--- a/libdocument/ev-document-factory.c
+++ b/libdocument/ev-document-factory.c
@@ -143,7 +143,7 @@ get_mime_type_from_data (const gchar *uri, GError **error)
size_read = g_input_stream_read (G_INPUT_STREAM (input_stream),
buffer, 1024, NULL, NULL);
- g_input_stream_close (G_INPUT_STREAM (input_stream), NULL, NULL);
+ g_input_stream_close (G_INPUT_STREAM (input_stream), NULL, error);
g_object_unref (file);
@@ -172,6 +172,13 @@ get_document_from_uri (const char *uri,
if (mime_type == NULL) {
g_free (mime_type);
+
+ if (*error == NULL) {
+ g_set_error (error,
+ EV_DOCUMENT_ERROR,
+ 0,
+ _("Unknown MIME Type"));
+ }
return NULL;
}