Commit c954f2d9 authored by Alexey Loktionov's avatar Alexey Loktionov

issue #2118: fix undefined method for nil:NilClass exception

parent ff9a2e2a
...@@ -7,8 +7,8 @@ class PostReceive ...@@ -7,8 +7,8 @@ class PostReceive
# Ignore push from non-gitlab users # Ignore push from non-gitlab users
user = if identifier.eql? Gitlab.config.gitolite_admin_key user = if identifier.eql? Gitlab.config.gitolite_admin_key
email = project.commit(newrev).author.email email = project.commit(newrev).author.email rescue nil
User.find_by_email(email) User.find_by_email(email) if email
elsif /^[A-Z0-9._%a-z\-]+@(?:[A-Z0-9a-z\-]+\.)+[A-Za-z]{2,4}$/.match(identifier) elsif /^[A-Z0-9._%a-z\-]+@(?:[A-Z0-9a-z\-]+\.)+[A-Za-z]{2,4}$/.match(identifier)
User.find_by_email(identifier) User.find_by_email(identifier)
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment