Skip to content

Commit

Permalink
Merge pull request #4565 from tulibraries/BL-1870-fix-array-coparison…
Browse files Browse the repository at this point in the history
…-fails

BL-1870: Fix array comparison fails when value is nil.
  • Loading branch information
ebtoner authored Jul 31, 2024
2 parents 688d445 + d375c02 commit 71d4489
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/models/solr_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 71d4489

Please sign in to comment.