Fix a critical warning.

This commit is contained in:
Michael James Gratton 2016-10-08 21:52:27 +11:00
parent 83c383ddd2
commit e6903fa65d

View file

@ -942,17 +942,19 @@ public class ConversationListBox : Gtk.ListBox {
}
private void on_row_activated(Gtk.ListBoxRow widget) {
EmailRow row = (EmailRow) widget;
// Allow non-last rows to be expanded/collapsed, but also let
// the last row to be expanded since appended sent emails will
// be appended last. Finally, don't let rows with active
// composers be collapsed.
if (row.is_expanded) {
if (row != this.last_row) {
row.collapse();
EmailRow? row = widget as EmailRow;
if (row != null) {
// Allow non-last rows to be expanded/collapsed, but also let
// the last row to be expanded since appended sent emails will
// be appended last. Finally, don't let rows with active
// composers be collapsed.
if (row.is_expanded) {
if (row != this.last_row) {
row.collapse();
}
} else {
row.expand();
}
} else {
row.expand();
}
}