[devhelp] BookTree: add missing g_returns



commit 4719f2ede5265fd88c8bdaa2c49a73177c2ec7ad
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Tue May 15 15:40:53 2018 +0200

    BookTree: add missing g_returns

 devhelp/dh-book-tree.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/devhelp/dh-book-tree.c b/devhelp/dh-book-tree.c
index 7fee833..1d794b7 100644
--- a/devhelp/dh-book-tree.c
+++ b/devhelp/dh-book-tree.c
@@ -966,11 +966,16 @@ void
 dh_book_tree_select_uri (DhBookTree  *tree,
                          const gchar *uri)
 {
-        DhBookTreePrivate *priv = dh_book_tree_get_instance_private (tree);
+        DhBookTreePrivate *priv;
         GtkTreeSelection *selection;
         FindURIData data;
         DhLink *link;
 
+        g_return_if_fail (DH_IS_BOOK_TREE (tree));
+        g_return_if_fail (uri != NULL);
+
+        priv = dh_book_tree_get_instance_private (tree);
+
         data.found = FALSE;
         data.uri = uri;
 
@@ -1030,6 +1035,8 @@ dh_book_tree_get_selected_book (DhBookTree *tree)
         GtkTreeModel *model;
         GtkTreeIter iter;
 
+        g_return_val_if_fail (DH_IS_BOOK_TREE (tree), NULL);
+
         selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree));
         if (!gtk_tree_selection_get_selected (selection, &model, &iter))
                 return NULL;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]