Skip to content

Commit

Permalink
check item linked to ldnMessage before storing a new solr document
Browse files Browse the repository at this point in the history
  • Loading branch information
frabacche committed Mar 4, 2024
1 parent f2683da commit c3ab2a1
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ public SolrInputDocument buildDocument(Context context, IndexableLDNNotification
doc.addField("queue_status_s", LDNMessageEntity.getQueueStatus(ldnMessage));
addFacetIndex(doc, "queue_status", String.valueOf(ldnMessage.getQueueStatus()),
LDNMessageEntity.getQueueStatus(ldnMessage));
if (ldnMessage.getObject() == null || ldnMessage.getObject().getID() == null) {
throw new SQLException("ldnMessage " + ldnMessage.getID() + " is linked to no Item.");
}
Item item = itemService.findByIdOrLegacyId(context, ldnMessage.getObject().getID().toString());
if (item != null) {
addFacetIndex(doc, "object", item.getID().toString(), itemService.getMetadata(item, "dc.title"));
Expand Down

0 comments on commit c3ab2a1

Please sign in to comment.