[gitg] Fix getting id of parent of there is no parent



commit 9af17f32ae1d9af4cf9689f8619eb058b734ee52
Author: Jesse van den Kieboom <jessevdk gnome org>
Date:   Sun Aug 14 10:30:38 2016 +0200

    Fix getting id of parent of there is no parent
    
    This would happen for the first commit in the repo

 libgitg/gitg-diff-view-commit-details.vala |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/libgitg/gitg-diff-view-commit-details.vala b/libgitg/gitg-diff-view-commit-details.vala
index 20aeb7f..0e53b27 100644
--- a/libgitg/gitg-diff-view-commit-details.vala
+++ b/libgitg/gitg-diff-view-commit-details.vala
@@ -104,11 +104,14 @@ class Gitg.DiffViewCommitDetails : Gtk.Grid
                        {
                                d_parent_commit = value;
 
-                               var button = d_parents_map[value.get_id()];
-
-                               if (button != null)
+                               if (value != null)
                                {
-                                       button.active = true;
+                                       var button = d_parents_map[value.get_id()];
+
+                                       if (button != null)
+                                       {
+                                               button.active = true;
+                                       }
                                }
                        }
                }


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