提交 a03f3189 编写于 作者: V Valeriy Sizov

Merge pull request #2119 from erroric/fix_issue2118

issue #2118: fix undefined method  for nil:NilClass exception
......@@ -7,8 +7,8 @@ class PostReceive
# Ignore push from non-gitlab users
user = if identifier.eql? Gitlab.config.gitolite_admin_key
email = project.commit(newrev).author.email
User.find_by_email(email)
email = project.commit(newrev).author.email rescue nil
User.find_by_email(email) if email
elsif /^[A-Z0-9._%a-z\-]+@(?:[A-Z0-9a-z\-]+\.)+[A-Za-z]{2,4}$/.match(identifier)
User.find_by_email(identifier)
else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册