[gtk] popover: Don't try to compute_bounds of a NULL child



commit 36e00ae95e68669364cde4373d390162ff853ed3
Author: Timm Bäder <mail baedert org>
Date:   Sat Mar 16 06:16:28 2019 +0100

    popover: Don't try to compute_bounds of a NULL child

 gtk/gtkpopover.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index c77ddc3f25..e118eb0e1f 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -338,7 +338,8 @@ gesture_released (GtkGestureMultiPress *gesture,
     return;
 
   child = gtk_bin_get_child (GTK_BIN (popover));
-  if (!gtk_widget_compute_bounds (child, GTK_WIDGET (popover), &child_bounds) ||
+  if (!child ||
+      !gtk_widget_compute_bounds (child, GTK_WIDGET (popover), &child_bounds) ||
       !graphene_rect_contains_point (&child_bounds,
                                      &(graphene_point_t){x, y}))
     gtk_popover_popdown (popover);


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