From d375c02adb57835c9905d94b11953fb44330a7c7 Mon Sep 17 00:00:00 2001 From: David Kinzer Date: Wed, 31 Jul 2024 15:49:56 -0400 Subject: [PATCH] BL-1870: Fix array comparison fails when value is nil. --- app/models/solr_document.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/solr_document.rb b/app/models/solr_document.rb index 7293f72fa..789d37d49 100644 --- a/app/models/solr_document.rb +++ b/app/models/solr_document.rb @@ -119,7 +119,11 @@ def document_items_grouped unless locations.empty? locations.each do |location, items| unless items.empty? - items.sort_by! { |item| [item["call_number_display"], item.fetch("description", "")] } + items.sort_by! { |item| + call_number = item.fetch("call_number_display", "") || "" + description = item.fetch("description", "") || "" + [call_number, description] + } end end end