Commit ecca0e1e authored by Daniel García Moreno's avatar Daniel García Moreno

Merge branch 'master' of

parents 59067ded d15928f8
......@@ -261,9 +261,16 @@ resource_callback (WebKitURISchemeRequest *request, gpointer user_data)
contents = gepub_doc_get_resource (widget->doc, path);
mime = gepub_doc_get_resource_mime (widget->doc, path);
// if the resource requested doesn't exist, we should serve an
// empty document instead of nothing at all (otherwise some
// poorly-structured ebooks will fail to render).
if (!contents) {
contents = g_byte_array_free_to_bytes(g_byte_array_sized_new(0));
mime = g_strdup("application/octet-stream");
if (!mime) {
g_free (uri);
mime = g_strdup("application/octet-stream");
stream = g_memory_input_stream_new_from_bytes (contents);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment