[gnome-utils] gdict: Remove assertion in sidebar code



commit 863354fde609ff71a63891245361c8df2059d491
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Fri Apr 8 09:15:30 2011 +0100

    gdict: Remove assertion in sidebar code
    
    Allow the sidebar page to be unset.

 gnome-dictionary/src/gdict-sidebar.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gnome-dictionary/src/gdict-sidebar.c b/gnome-dictionary/src/gdict-sidebar.c
index 52f66f1..9f86e69 100644
--- a/gnome-dictionary/src/gdict-sidebar.c
+++ b/gnome-dictionary/src/gdict-sidebar.c
@@ -537,7 +537,8 @@ gdict_sidebar_current_page (GdictSidebar *sidebar)
   
   index = gtk_notebook_get_current_page (GTK_NOTEBOOK (priv->notebook));
   page = g_slist_nth_data (priv->pages, index);
-  g_assert (page != NULL);
+  if (page == NULL)
+    return NULL;
 
   return page->id;
 }



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