Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAlexey Loktionov <la@dalee.ru>2012-11-29 19:38:06 +0400
committerAlexey Loktionov <la@dalee.ru>2012-11-29 19:39:30 +0400
commitc954f2d98221eadd288b9a4a13c7ca06b92ec9a2 (patch)
treeacc49823704a721c04f14da9f94ebb6e120d57c2 /app
parentff9a2e2a9399bf1d190de7fab2d1d26b70433b19 (diff)
issue #2118: fix undefined method for nil:NilClass exception
Diffstat (limited to 'app')
-rw-r--r--app/workers/post_receive.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/workers/post_receive.rb b/app/workers/post_receive.rb
index 10128660cd4..4f4f69c4ece 100644
--- a/app/workers/post_receive.rb
+++ b/app/workers/post_receive.rb
@@ -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