Commit c954f2d98221eadd288b9a4a13c7ca06b92ec9a2

Authored by Alexey Loktionov
1 parent ff9a2e2a

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

Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
app/workers/post_receive.rb
... ... @@ -7,8 +7,8 @@ class PostReceive
7 7  
8 8 # Ignore push from non-gitlab users
9 9 user = if identifier.eql? Gitlab.config.gitolite_admin_key
10   - email = project.commit(newrev).author.email
11   - User.find_by_email(email)
  10 + email = project.commit(newrev).author.email rescue nil
  11 + User.find_by_email(email) if email
12 12 elsif /^[A-Z0-9._%a-z\-]+@(?:[A-Z0-9a-z\-]+\.)+[A-Za-z]{2,4}$/.match(identifier)
13 13 User.find_by_email(identifier)
14 14 else
... ...