[gitg/cherry-pick-b49eca0b] GitgHistory.RefRow: Don't assume that	every GgitSignature has a time
- From: Simon McVittie <smcv src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gitg/cherry-pick-b49eca0b] GitgHistory.RefRow: Don't assume that	every GgitSignature has a time
 
- Date: Mon, 16 Sep 2019 09:48:07 +0000 (UTC)
 
commit 8ef12dc80c5edcfb7f7d66596e565024685bd9ef
Author: Simon McVittie <smcv debian org>
Date:   Tue Aug 20 09:49:45 2019 +0000
    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
    
    
    (cherry picked from commit b49eca0bd0d917d36098c8da644b988a70028645)
 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]