summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMałgorzata Ksionek <mksionek@gitlab.com>2019-07-08 17:04:08 +0200
committerMałgorzata Ksionek <mksionek@gitlab.com>2019-07-09 12:16:38 +0200
commit2d283dd4035e1b09525ba681b65987abad3d152a (patch)
tree3ff2fe234c7da3898b880186b8c4209fa7471700
parent3459ba13b21f3df64983c795e8c22339b8197298 (diff)
downloadgitlab-ce-2d283dd4035e1b09525ba681b65987abad3d152a.tar.gz
Add guard clause
-rw-r--r--lib/gitlab/cycle_analytics/base_stage.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/gitlab/cycle_analytics/base_stage.rb b/lib/gitlab/cycle_analytics/base_stage.rb
index 9e64dcb87e2..338274250e6 100644
--- a/lib/gitlab/cycle_analytics/base_stage.rb
+++ b/lib/gitlab/cycle_analytics/base_stage.rb
@@ -23,6 +23,8 @@ module Gitlab
end
def median
+ return if @project.nil?
+
BatchLoader.for(@project.id).batch(key: name) do |project_ids, loader|
if project_ids.one?
loader.call(@project.id, median_query(project_ids))