summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garcia Campos <cgarcia@igalia.com>2015-06-16 10:01:52 +0200
committerDavid King <amigadave@amigadave.com>2015-06-22 14:56:04 +0100
commitdd6782b43481cdab9935cb762db9f32ef992df8c (patch)
tree4d20a3ca60fc56eb8becd38fe32f1ec13a43666c
parent83abdc8259030cbff97321186384ca6e9c809a8f (diff)
downloadyelp-dd6782b43481cdab9935cb762db9f32ef992df8c.tar.gz
libyelp: fix runtime critical warning at startup when loading info document
YelpURI doesn't set a page_id when resolving info URIs, but YelpDocument assumes it can't be NULL in document_request_page(). Simply check it's not NULL before trying to use g_str_has_prefix().
-rw-r--r--libyelp/yelp-document.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libyelp/yelp-document.c b/libyelp/yelp-document.c
index 0ee1219f..c7c2f1f1 100644
--- a/libyelp/yelp-document.c
+++ b/libyelp/yelp-document.c
@@ -857,7 +857,7 @@ document_request_page (YelpDocument *document,
g_mutex_lock (&document->priv->mutex);
- if (g_str_has_prefix (page_id, "search=")) {
+ if (page_id && g_str_has_prefix (page_id, "search=")) {
document->priv->reqs_search = g_slist_prepend (document->priv->reqs_search, request);
if (document->priv->indexed)
g_idle_add ((GSourceFunc) document_indexed, document);