diff --git a/src/main/java/fr/abes/bestppn/model/dto/kafka/LigneKbartDto.java b/src/main/java/fr/abes/bestppn/model/dto/kafka/LigneKbartDto.java index 6172eb6..29c20a6 100644 --- a/src/main/java/fr/abes/bestppn/model/dto/kafka/LigneKbartDto.java +++ b/src/main/java/fr/abes/bestppn/model/dto/kafka/LigneKbartDto.java @@ -159,11 +159,11 @@ public String getAuthor() { @JsonIgnore public String getAnneeFromDate_monograph_published_print() { - return this.dateMonographPublishedPrint.substring(0, 4); + return (this.dateMonographPublishedPrint != null && !this.dateMonographPublishedPrint.isEmpty()) ? this.dateMonographPublishedPrint.substring(0, 4) : this.dateMonographPublishedPrint; } @JsonIgnore public String getAnneeFromDate_monograph_published_online() { - return this.dateMonographPublishedOnline.substring(0, 4); + return (this.dateMonographPublishedOnline != null && !this.dateMonographPublishedOnline.isEmpty()) ? this.dateMonographPublishedOnline.substring(0, 4) : this.dateMonographPublishedOnline; } }