Use try for commit prev_commit_id detection
This commit is contained in:
parent
45b18365d5
commit
1845429268
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue