From 137e38ec555acefc6436c4fd4dc650ca8107155f Mon Sep 17 00:00:00 2001 From: Richard Hallett Date: Tue, 30 Oct 2018 12:48:21 +0100 Subject: [PATCH] Only check ability if we have it passed in --- app/serializers/doi_serializer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/serializers/doi_serializer.rb b/app/serializers/doi_serializer.rb index 0fea3a694..880473178 100644 --- a/app/serializers/doi_serializer.rb +++ b/app/serializers/doi_serializer.rb @@ -44,7 +44,7 @@ class DoiSerializer attribute :landing_page, if: Proc.new { |object, params| - params && params[:current_ability].can?(:read_landing_page_results, object) == true + params[:current_ability] && params[:current_ability].can?(:read_landing_page_results, object) == true } do |object| { status: object.last_landing_page_status, "content-type" => object.last_landing_page_content_type,