summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-11-28 13:59:04 +0900
committerShinya Maeda <shinya@gitlab.com>2018-11-28 13:59:04 +0900
commitdc96d96ac536cd7b1a91f3505af9df6c214750d3 (patch)
treec05c06dbe82ab19fd9356bd98621bf19bb6af3a6
parenta3ba7b3119e857c61d9a270c1e59922ab4d7c434 (diff)
downloadgitlab-ce-fix-mr-widget-unrelated-deployment-status.tar.gz
Return empty array if pipeline is nilfix-mr-widget-unrelated-deployment-status
-rw-r--r--app/models/environment_status.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/environment_status.rb b/app/models/environment_status.rb
index 4483fe86b5b..9e72d7e9bb4 100644
--- a/app/models/environment_status.rb
+++ b/app/models/environment_status.rb
@@ -77,7 +77,7 @@ class EnvironmentStatus
end
def self.build_environments_status(mr, user, pipeline)
- return unless pipeline
+ return [] unless pipeline
pipeline.environments.map do |environment|
next unless Ability.allowed?(user, :read_environment, environment)