Commit 1845429268364e75bffdeb1075de8f1606e157ec

Authored by Dmitriy Zaporozhets
1 parent 45b18365

Use try for commit prev_commit_id detection

Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
app/models/commit.rb
... ... @@ -120,10 +120,10 @@ class Commit
120 120 end
121 121  
122 122 def prev_commit
123   - parents.first
  123 + parents.try :first
124 124 end
125 125  
126 126 def prev_commit_id
127   - prev_commit.id
  127 + prev_commit.try :id
128 128 end
129 129 end
... ...