[libadwaita/wip/exalm/tab-fix] tab-box: Fix a crash in reorder_begin_cb()




commit 368933d322c3436fddcfc768bae1f73fa040505e
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 d2f0606f..67bba257 100644
--- a/src/adw-tab-box.c
+++ b/src/adw-tab-box.c
@@ -1560,6 +1560,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, FALSE);
   self->drag_offset_y = start_y;
 


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