From 0de0222c8e25888fca730e258e87f929ee7ede65 Mon Sep 17 00:00:00 2001 From: pierre-maraval Date: Wed, 15 May 2024 13:49:47 +0200 Subject: [PATCH] =?UTF-8?q?fix=20:=20prise=20en=20compte=20cas=20dateMonog?= =?UTF-8?q?raph=20null=20lors=20de=20l'extraction=20de=20l'ann=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/fr/abes/bestppn/model/dto/kafka/LigneKbartDto.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } }