Skip to content

Commit

Permalink
MET-5974: small fix for absence of country in organization.
Browse files Browse the repository at this point in the history
  • Loading branch information
jochen-vermeulen committed May 13, 2024
1 parent 548f562 commit aa206e9
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
import static eu.europeana.enrichment.utils.EntityValuesConverter.convertMultilingualMapToLabel;
import static eu.europeana.enrichment.utils.EntityValuesConverter.getVcardAddresses;

import eu.europeana.entitymanagement.definitions.model.Entity;
import java.util.ArrayList;
import java.util.List;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlRootElement;
import java.util.Optional;

/**
* This class stores result of the parsing of XSLT/XML organization file with Wikidata content
Expand Down Expand Up @@ -136,7 +138,7 @@ public void setDepiction(Resource depiction) {
}

private void init(eu.europeana.entitymanagement.definitions.model.Organization organization) {
this.country = organization.getCountry().getEntityId();
this.country = Optional.ofNullable(organization.getCountry()).map(Entity::getEntityId).orElse(null);
this.homepage = new Resource(organization.getHomepage());
this.descriptions = convertMapToLabels(organization.getDescription());
this.acronyms = convertMultilingualMapToLabel(organization.getAcronym());
Expand Down

0 comments on commit aa206e9

Please sign in to comment.