Skip to content

Commit

Permalink
ignore creators with [null] values
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorrit Poelen committed Sep 6, 2024
1 parent 654662f commit 0c12912
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static ObjectNode toPhotoDeposit(JsonNode multimediaRecord, PublicationDa
}

JsonNode creatorNode = multimediaRecord.get("http://purl.org/dc/elements/1.1/creator");
List<String> creators = Arrays.asList(creatorNode == null ? "Museum für Naturkunde Berlin" : creatorNode.asText());
List<String> creators = Arrays.asList(creatorNode == null || creatorNode.isNull() ? "Museum für Naturkunde Berlin" : creatorNode.asText());
populatePhotoDepositMetadata(
zenodoMetadata,
filename,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ public void photoDeposit() throws IOException {
ObjectNode zenodoDeposit = DarkTaxonUtil.toPhotoDeposit(multimedia, getPublicationDateFactory(), Arrays.asList("mfn-test"));

String actual = zenodoDeposit.toPrettyString();

System.out.println(actual);


assertThat(actual, Is.is(IOUtils.toString(getClass().getResourceAsStream("darktaxon/multimedia-zenodo.json"), StandardCharsets.UTF_8)));

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"upload_type" : "image",
"image_type" : "photo",
"creators" : [ {
"name" : "null"
"name" : "Museum für Naturkunde Berlin"
} ],
"publication_date" : "1999-12-31",
"communities" : [ {
Expand Down

0 comments on commit 0c12912

Please sign in to comment.