From dc96d96ac536cd7b1a91f3505af9df6c214750d3 Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Wed, 28 Nov 2018 13:59:04 +0900 Subject: Return empty array if pipeline is nil --- app/models/environment_status.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- cgit v1.2.1