Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Account for nil related_identifiers when indexing related_dois #1059

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/models/doi/indexer/related_doi_indexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
module Doi::Indexer
class RelatedDoiIndexer
def initialize(related_identifiers)
@related_identifiers = related_identifiers
@related_identifiers = Array.wrap(related_identifiers)
@related_dois = nil
end

def related_dois
@related_dois ||= @related_identifiers.select { |r| r["relatedIdentifierType"] == "DOI" }
@related_dois ||= @related_identifiers.select { |r| r.fetch("relatedIdentifierType", nil) == "DOI" }
end

def related_grouped_by_id
Expand Down