[gnome-control-center] shell: Assert when the panel is empty



commit ce0387d54f3d22e6874d224480f628f29167836d
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Dec 2 15:52:38 2013 +0100

    shell: Assert when the panel is empty
    
    Rather than getting a segfault.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=719711

 shell/cc-panel.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/shell/cc-panel.c b/shell/cc-panel.c
index 1ce6716..31093b6 100644
--- a/shell/cc-panel.c
+++ b/shell/cc-panel.c
@@ -190,16 +190,18 @@ cc_panel_get_preferred_height (GtkWidget *widget,
 
 static void
 cc_panel_size_allocate (GtkWidget     *widget,
-                             GtkAllocation *allocation)
+                        GtkAllocation *allocation)
 {
   GtkAllocation child_allocation;
+  GtkWidget *child;
 
   gtk_widget_set_allocation (widget, allocation);
 
   child_allocation = *allocation;
 
-  gtk_widget_size_allocate (gtk_bin_get_child (GTK_BIN (widget)),
-                            &child_allocation);
+  child = gtk_bin_get_child (GTK_BIN (widget));
+  g_assert (child);
+  gtk_widget_size_allocate (child, &child_allocation);
 }
 
 static void


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