[gnome-builder/wip/chergert/layout] layout: handle calls before a child is added



commit bc9b93f7f5d48a0dbae5a10c589e28e87b2e77f6
Author: Christian Hergert <chergert redhat com>
Date:   Fri Jul 14 16:54:17 2017 -0700

    layout: handle calls before a child is added

 libide/layout/ide-layout-grid.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/libide/layout/ide-layout-grid.c b/libide/layout/ide-layout-grid.c
index 38cd428..36832ad 100644
--- a/libide/layout/ide-layout-grid.c
+++ b/libide/layout/ide-layout-grid.c
@@ -630,13 +630,13 @@ IdeLayoutGridColumn *
 ide_layout_grid_get_current_column (IdeLayoutGrid *self)
 {
   IdeLayoutGridPrivate *priv = ide_layout_grid_get_instance_private (self);
-  GtkWidget *ret;
+  GtkWidget *ret = NULL;
 
   g_return_val_if_fail (IDE_IS_LAYOUT_GRID (self), NULL);
 
   if (priv->focus_column.head != NULL)
     ret = priv->focus_column.head->data;
-  else
+  else if (dzl_multi_paned_get_n_children (DZL_MULTI_PANED (self)) > 0)
     ret = dzl_multi_paned_get_nth_child (DZL_MULTI_PANED (self), 0);
 
   if (ret == NULL)


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