Use try for commit prev_commit_id detection

This commit is contained in:
Dmitriy Zaporozhets 2012-04-19 23:35:35 +03:00
parent 45b18365d5
commit 1845429268

View file

@ -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