[libadwaita/libadwaita-1-1] tab-box: Fix a crash in reorder_begin_cb()



commit a7db9c077dbd1853c0fc62e44ac20a3d1ff149ad
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Tue Aug 16 17:22:16 2022 +0400

    tab-box: Fix a crash in reorder_begin_cb()
    
    While it was mostly noticeable in AdwTabGrid instead, it's possible to
    reproduce this with non-expanded tabs: drag a tab, then click empty space
    while it's animating.

 src/adw-tab-box.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/adw-tab-box.c b/src/adw-tab-box.c
index 54178555..011721de 100644
--- a/src/adw-tab-box.c
+++ b/src/adw-tab-box.c
@@ -1402,6 +1402,9 @@ reorder_begin_cb (AdwTabBox  *self,
 
   self->pressed_tab = find_tab_info_at (self, start_x);
 
+  if (!self->pressed_tab)
+    return;
+
   self->drag_offset_x = start_x - get_tab_position (self, self->pressed_tab);
   self->drag_offset_y = start_y;
 


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