[yelp] Fail more gracefully in bookmark functions if we get passed a null.
- From: Shaun McCance <shaunm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [yelp] Fail more gracefully in bookmark functions if we get passed a null.
- Date: Mon, 20 Dec 2010 15:47:53 +0000 (UTC)
commit 6dc128e493e294cc72cd4380e1d3ec1e5675ddbd
Author: Rupert Swarbrick <rswarbrick gmail com>
Date: Thu Dec 16 23:56:21 2010 +0000
Fail more gracefully in bookmark functions if we get passed a null.
The new (at least) man parsing code obviously has a bug where it's not
setting a page_id that it should. But this shouldn't cause a segfault!
src/yelp-application.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/yelp-application.c b/src/yelp-application.c
index 0921d16..cae00dd 100644
--- a/src/yelp-application.c
+++ b/src/yelp-application.c
@@ -674,6 +674,9 @@ yelp_application_remove_bookmark (YelpBookmarks *bookmarks,
GSettings *settings;
YelpApplication *app = YELP_APPLICATION (bookmarks);
+ g_return_if_fail (page_id);
+ g_return_if_fail (doc_uri);
+
settings = application_get_doc_settings (app, doc_uri);
if (settings) {
@@ -704,6 +707,9 @@ yelp_application_is_bookmarked (YelpBookmarks *bookmarks,
GSettings *settings;
YelpApplication *app = YELP_APPLICATION (bookmarks);
+ g_return_if_fail (page_id);
+ g_return_if_fail (doc_uri);
+
settings = application_get_doc_settings (app, doc_uri);
if (settings == NULL)
return FALSE;
@@ -731,6 +737,9 @@ yelp_application_update_bookmarks (YelpApplication *app,
{
GSettings *settings;
+ g_return_if_fail (page_id);
+ g_return_if_fail (doc_uri);
+
settings = application_get_doc_settings (app, doc_uri);
if (settings) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]