summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Smith <bmsmith@src.gnome.org>2006-09-03 15:35:51 +0000
committerBrent Smith <bmsmith@src.gnome.org>2006-09-03 15:35:51 +0000
commit27eddf9ebcae0ba33ef896b0e64e07f00354f3af (patch)
tree6560ede55e1652e1e966860ff4b4ece7a5a0e35e
parentba276e56574b7f3463e9c7ab696619b57db06835 (diff)
downloadyelp-27eddf9ebcae0ba33ef896b0e64e07f00354f3af.tar.gz
check if the document category exists, and return if it does not should
* src/yelp-toc-pager.c: (toc_add_doc_info): check if the document category exists, and return if it does not should fix 353554
-rw-r--r--ChangeLog5
-rw-r--r--src/yelp-toc-pager.c17
2 files changed, 20 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 2cf60416..65d7455f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-09-03 Brent Smith <gnome@nextreality.net>
+
+ * src/yelp-toc-pager.c: (toc_add_doc_info): check if the document
+ category exists, and return if it does not should fix 353554
+
2006-08-30 Don Scorgie <don@Madaline>
* src/yelp-io-channel.c:
diff --git a/src/yelp-toc-pager.c b/src/yelp-toc-pager.c
index 09d3db88..71c1b818 100644
--- a/src/yelp-toc-pager.c
+++ b/src/yelp-toc-pager.c
@@ -2062,6 +2062,20 @@ toc_add_doc_info (YelpTocPager *pager, YelpDocInfo *doc_info)
xmlNodePtr node;
xmlNodePtr new;
gchar *text;
+ gchar *category;
+
+ g_return_if_fail (pager != NULL);
+ if (doc_info == NULL)
+ return;
+
+ /* check if the document category exists, and return if it does not
+ * should fix 353554 */
+ category = yelp_doc_info_get_category (doc_info);
+ if (category == NULL) {
+ debug_print (DB_DEBUG, "Missing category for %s\n",
+ yelp_doc_info_get_title (doc_info));
+ return;
+ }
YelpTocPagerPriv *priv = pager->priv;
@@ -2069,8 +2083,7 @@ toc_add_doc_info (YelpTocPager *pager, YelpDocInfo *doc_info)
(gchar *) yelp_doc_info_get_id (doc_info),
doc_info);
- node = g_hash_table_lookup (priv->category_hash,
- yelp_doc_info_get_category (doc_info));
+ node = g_hash_table_lookup (priv->category_hash, category);
text = yelp_doc_info_get_uri (doc_info, NULL, YELP_URI_TYPE_FILE);
new = xmlNewChild (node, NULL, BAD_CAST "doc", NULL);