summaryrefslogtreecommitdiff
path: root/libyelp/yelp-view.c
diff options
context:
space:
mode:
Diffstat (limited to 'libyelp/yelp-view.c')
-rw-r--r--libyelp/yelp-view.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/libyelp/yelp-view.c b/libyelp/yelp-view.c
index 1f10000c..9b2e5fb2 100644
--- a/libyelp/yelp-view.c
+++ b/libyelp/yelp-view.c
@@ -780,17 +780,19 @@ document_callback (YelpDocument *document,
contents = yelp_document_read_contents (document, data->page_id);
- content_length = strlen (contents);
-
- stream = g_memory_input_stream_new_from_data (g_strdup (contents), content_length, g_free);
- yelp_document_finish_read (document, contents);
-
- webkit_uri_scheme_request_finish (data->request,
- stream,
- content_length,
- mime_type);
- g_free (mime_type);
- g_object_unref (stream);
+ if (contents) {
+ content_length = strlen (contents);
+
+ stream = g_memory_input_stream_new_from_data (g_strdup (contents), content_length, g_free);
+ yelp_document_finish_read (document, contents);
+
+ webkit_uri_scheme_request_finish (data->request,
+ stream,
+ content_length,
+ mime_type);
+ g_free (mime_type);
+ g_object_unref (stream);
+ }
}
static void