[gnome-contacts/gnome-3-30] ContactList: fix segfault when right-clicking.



commit 4d49786cb1185b5a20f1b53df9b1aed900f94ce4
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Thu Sep 13 00:22:05 2018 +0200

    ContactList: fix segfault when right-clicking.
    
    Fixes #104

 src/contacts-contact-list.vala | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/contacts-contact-list.vala b/src/contacts-contact-list.vala
index 4f75316..2d39739 100644
--- a/src/contacts-contact-list.vala
+++ b/src/contacts-contact-list.vala
@@ -282,8 +282,10 @@ public class Contacts.ContactList : ListBox {
 
     if (event.button == Gdk.BUTTON_SECONDARY) {
       var row = (ContactDataRow) get_row_at_y ((int) Math.round (event.y));
-      select_row (row);
-      row.selector_button.active = (this.state != UiState.SELECTING) || !row.selector_button.active;
+      if (row != null) {
+        select_row (row);
+        row.selector_button.active = this.state != UiState.SELECTING || !row.selector_button.active;
+      }
     }
 
     return false;


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