[gitg] GitgHistory.RefRow: Don't assume that every GgitSignature has a time



commit b49eca0bd0d917d36098c8da644b988a70028645
Author: Simon McVittie <smcv debian org>
Date:   Tue Aug 20 10:49:45 2019 +0100

    GitgHistory.RefRow: Don't assume that every GgitSignature has a time
    
    The libostree and libreswan git repositories include counterexamples.
    
    Signed-off-by: Simon McVittie <smcv debian org>
    Fixes: https://gitlab.gnome.org/GNOME/gitg/issues/73
    Bug-Debian: https://bugs.debian.org/935136

 gitg/history/gitg-history-refs-list.vala | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gitg/history/gitg-history-refs-list.vala b/gitg/history/gitg-history-refs-list.vala
index 75ecd438..3d026bf0 100644
--- a/gitg/history/gitg-history-refs-list.vala
+++ b/gitg/history/gitg-history-refs-list.vala
@@ -286,8 +286,11 @@ private class RefRow : RefTyped, Gtk.ListBoxRow
                        {
                                var c1 = d_updated;
                                var c2 = other.updated;
+                               var dt1 = c1.get_time();
+                               var dt2 = c2.get_time();
 
-                               return c2.get_time().compare(c1.get_time());
+                               if (dt1 != null && dt2 != null)
+                                       return dt2.compare(dt1);
                        }
                }
 


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