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
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2019-08-27 06:51:28 +0300
committerShinya Maeda <shinya@gitlab.com>2019-08-30 14:45:00 +0300
commitf246db4446466de58ba8618fb77bea63ca976551 (patch)
tree2731e145a0d7c77230de01e3c1c3d6b30d8efffb /app/serializers/deployment_entity.rb
parent153f25af9ccb3b35f0dc4111afc4da5112c27b13 (diff)
Fix deployable nil exception on job controller
When deployable is nil, we gracefully take care of the case.
Diffstat (limited to 'app/serializers/deployment_entity.rb')
-rw-r--r--app/serializers/deployment_entity.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/serializers/deployment_entity.rb b/app/serializers/deployment_entity.rb
index 8b967459173..94a827658f0 100644
--- a/app/serializers/deployment_entity.rb
+++ b/app/serializers/deployment_entity.rb
@@ -23,7 +23,7 @@ class DeploymentEntity < Grape::Entity
expose :last?
expose :deployed_by, as: :user, using: UserEntity
- expose :deployable do |deployment, opts|
+ expose :deployable, if: -> (deployment) { deployment.deployable.present? } do |deployment, opts|
deployment.deployable.yield_self do |deployable|
if include_details?
JobEntity.represent(deployable, opts)