[libhandy] stackable-box: Add a missing null check



commit 18f5d5422b799c79920384459ac456c0cb12cb97
Author: Nahuel Gomez Castro <nahual_gomca outlook com ar>
Date:   Sun Mar 21 19:49:48 2021 -0300

    stackable-box: Add a missing null check
    
    The visible-child on a unfoldable stackable box can be null too, so we
    need to check for that possibility before we do anything.

 src/hdy-stackable-box.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/hdy-stackable-box.c b/src/hdy-stackable-box.c
index 3971ff5c..80adc80c 100644
--- a/src/hdy-stackable-box.c
+++ b/src/hdy-stackable-box.c
@@ -1668,8 +1668,11 @@ hdy_stackable_box_size_allocate_unfolded (HdyStackableBox *self,
   GtkTextDirection direction;
   gboolean under;
 
-  directed_children = get_directed_children (self);
   visible_child = self->visible_child;
+  if (!visible_child)
+    return;
+
+  directed_children = get_directed_children (self);
 
   box_homogeneous = (self->homogeneous[HDY_FOLD_UNFOLDED][GTK_ORIENTATION_HORIZONTAL] && orientation == 
GTK_ORIENTATION_HORIZONTAL) ||
                     (self->homogeneous[HDY_FOLD_UNFOLDED][GTK_ORIENTATION_VERTICAL] && orientation == 
GTK_ORIENTATION_VERTICAL);


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