Skip to content

Commit

Permalink
VENOM-466: Fix crash when right clicking empty contact list
Browse files Browse the repository at this point in the history
  • Loading branch information
naxuroqa committed Dec 21, 2018
1 parent 89b0009 commit 3610039
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/view/ContactListWidget.vala
Expand Up @@ -112,11 +112,13 @@ namespace Venom {
if (ev.type == Gdk.EventType.BUTTON_PRESS && ev.button == 3) {
logger.d("right mouse clicked");
var row = contact_list.get_row_at_y((int) ev.y);
var contact = contact_list_model.get_object(row.get_index()) as IContact;
var menu = view_model.popup_menu(contact);
var popover = new Gtk.Popover.from_model(row, menu);
popover.popup();
return true;
if (row != null) {
var contact = contact_list_model.get_object(row.get_index()) as IContact;
var menu = view_model.popup_menu(contact);
var popover = new Gtk.Popover.from_model(row, menu);
popover.popup();
return true;
}
}
return false;
}
Expand Down

0 comments on commit 3610039

Please sign in to comment.