[geary] Fix a critical warning.



commit e6903fa65df2ecee7d3d1d32319598fdee8fde3c
Author: Michael James Gratton <mike vee net>
Date:   Sat Oct 8 21:52:27 2016 +1100

    Fix a critical warning.

 .../conversation-viewer/conversation-list-box.vala |   22 ++++++++++---------
 1 files changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-list-box.vala 
b/src/client/conversation-viewer/conversation-list-box.vala
index a8173c1..f36fd74 100644
--- a/src/client/conversation-viewer/conversation-list-box.vala
+++ b/src/client/conversation-viewer/conversation-list-box.vala
@@ -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();
         }
     }
 


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