Prevent nil exception in environment status

This commit is contained in:
Shinya Maeda 2018-11-06 20:47:23 +09:00
parent ee373f28a1
commit b4ae55f4aa
1 changed files with 2 additions and 2 deletions

View File

@ -8,8 +8,8 @@ class EnvironmentStatus
delegate :id, to: :environment
delegate :name, to: :environment
delegate :project, to: :environment
delegate :status, to: :deployment
delegate :deployed_at, to: :deployment
delegate :status, to: :deployment, allow_nil: true
delegate :deployed_at, to: :deployment, allow_nil: true
def self.for_merge_request(mr, user)
build_environments_status(mr, user, mr.head_pipeline)