summaryrefslogtreecommitdiff
path: root/app/serializers
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-01-20 12:44:31 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-01-20 12:44:31 +0100
commit1f314195ea79e0c2610c979c6716134ebe21ec2a (patch)
tree741ecd91c2f6e717dbde65d528a5a529307ae0ee /app/serializers
parent5a41d92b9d73cbc41b649239e40a15955094f77e (diff)
downloadgitlab-ce-1f314195ea79e0c2610c979c6716134ebe21ec2a.tar.gz
Do not generate pipeline ref path if ref not present
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/pipeline_entity.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/app/serializers/pipeline_entity.rb b/app/serializers/pipeline_entity.rb
index d04a4990cb0..61f0f11d7d2 100644
--- a/app/serializers/pipeline_entity.rb
+++ b/app/serializers/pipeline_entity.rb
@@ -40,10 +40,12 @@ class PipelineEntity < Grape::Entity
end
expose :path do |pipeline|
- namespace_project_tree_path(
- pipeline.project.namespace,
- pipeline.project,
- id: pipeline.ref)
+ if pipeline.ref
+ namespace_project_tree_path(
+ pipeline.project.namespace,
+ pipeline.project,
+ id: pipeline.ref)
+ end
end
expose :tag?, as: :tag