diff --git a/app/serializers/build_serializer.rb b/app/serializers/build_serializer.rb index 2c9cf99811e869c97e1658e98135a42afd794581..c5dbb391ce08af70db564b75abf62422e2f89706 100644 --- a/app/serializers/build_serializer.rb +++ b/app/serializers/build_serializer.rb @@ -7,6 +7,6 @@ class BuildSerializer < BaseSerializer def represent_status(resource) data = represent(resource, { only: [:status] }) - data[:status] + data.fetch(:status, {}) end end diff --git a/app/serializers/pipeline_serializer.rb b/app/serializers/pipeline_serializer.rb index 62f31d4c5adfe741af389f96fcf0eb14f19f91ac..384e881da0660b388c19bd36ebcd58848cf5cd75 100644 --- a/app/serializers/pipeline_serializer.rb +++ b/app/serializers/pipeline_serializer.rb @@ -25,6 +25,6 @@ class PipelineSerializer < BaseSerializer def represent_status(resource) data = represent(resource, { only: [{ details: [:status] }] }) - data[:details][:status] + data.fetch(:details, {}).fetch(:status, {}) end end