summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schmid <jhs@gnome.org>2010-05-09 19:33:22 +0200
committerJohannes Schmid <jhs@gnome.org>2010-05-09 19:33:22 +0200
commit330ca259d1ca0c15709bd334c7779e9a9b319eb3 (patch)
tree9c4dacb3f913a45f4586e7180ff063ce42393f3b
parent2e58dba5ef28ac1f1d3153a8e4335af098982984 (diff)
downloadglade-330ca259d1ca0c15709bd334c7779e9a9b319eb3.tar.gz
glade-widget: Add a g_return_if_fail() if we cannot find an apator for widgets
Also checks in glade-project.c if we found a widget.
-rw-r--r--gladeui/glade-project.c2
-rw-r--r--gladeui/glade-widget.c11
2 files changed, 9 insertions, 4 deletions
diff --git a/gladeui/glade-project.c b/gladeui/glade-project.c
index e4188fa4..7307cb69 100644
--- a/gladeui/glade-project.c
+++ b/gladeui/glade-project.c
@@ -4532,6 +4532,8 @@ glade_project_model_iter_children (GtkTreeModel* model,
if (parent)
{
GladeWidget* widget = glade_widget_get_from_gobject (parent->user_data);
+ if (widget)
+ return FALSE;
GList* children = glade_widget_get_children (widget);
if (children)
{
diff --git a/gladeui/glade-widget.c b/gladeui/glade-widget.c
index 61af7a1d..95c04f2d 100644
--- a/gladeui/glade-widget.c
+++ b/gladeui/glade-widget.c
@@ -3448,12 +3448,15 @@ glade_widget_set_parent (GladeWidget *widget,
* Returns: The children of widget
*/
GList *
-glade_widget_get_children (GladeWidget* widget)
+glade_widget_get_children (GladeWidget *widget)
{
- GladeWidgetAdaptor* adaptor = glade_widget_get_adaptor (widget);
- GList* children = NULL;
- GList* node;
+ GladeWidgetAdaptor *adaptor;
+ GList *children = NULL;
+ GList *node;
+
+ g_return_val_if_fail (GLADE_IS_WIDGET (widget), NULL);
+ adaptor = glade_widget_get_adaptor (widget);
children = glade_widget_adaptor_get_children (adaptor, widget->object);
for (node = children; node != NULL; node = g_list_next (node))
{