X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=libdocument%2Fev-document-factory.c;h=a920be60bcfe06e2a051866700212b29160a7639;hb=63e5b30126ea0dc16cf1e85193aacd294854c87f;hp=64eaabaa25d52ac37487db5cf3367ab05c6dbca9;hpb=0c59b99bc6ad737227a6c684105810b0e04294f5;p=evince.git diff --git a/libdocument/ev-document-factory.c b/libdocument/ev-document-factory.c index 64eaabaa..a920be60 100644 --- a/libdocument/ev-document-factory.c +++ b/libdocument/ev-document-factory.c @@ -23,6 +23,7 @@ #endif #include + #include #include #include @@ -143,7 +144,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 +173,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; }