From 1845429268364e75bffdeb1075de8f1606e157ec Mon Sep 17 00:00:00 2001
From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Date: Thu, 19 Apr 2012 23:35:35 +0300
Subject: [PATCH] Use try for commit prev_commit_id detection

---
 app/models/commit.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/models/commit.rb b/app/models/commit.rb
index f90c42672d..263e2f7429 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -120,10 +120,10 @@ class Commit
   end
 
   def prev_commit
-    parents.first
+    parents.try :first
   end
 
   def prev_commit_id
-    prev_commit.id
+    prev_commit.try :id
   end
 end
-- 
2.30.9