From 460728367243e35696377c218dd426c19d56d18b Mon Sep 17 00:00:00 2001 From: Alexander Schwarz Date: Fri, 17 Sep 2021 14:45:24 +0200 Subject: [PATCH] fix null pointer on birth day --- .../ec/dgc/validation/decorator/service/DccTokenService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/europa/ec/dgc/validation/decorator/service/DccTokenService.java b/src/main/java/eu/europa/ec/dgc/validation/decorator/service/DccTokenService.java index b60a93d..b380f20 100644 --- a/src/main/java/eu/europa/ec/dgc/validation/decorator/service/DccTokenService.java +++ b/src/main/java/eu/europa/ec/dgc/validation/decorator/service/DccTokenService.java @@ -93,7 +93,9 @@ private AccessTokenPayload buildAccessToken( accessTokenConditions.setLang(occurrenceInfo.getLanguage()); accessTokenConditions.setFnt(subjectResponse.getForename()); accessTokenConditions.setGnt(subjectResponse.getLastname()); - accessTokenConditions.setDob(subjectResponse.getBirthDate().format(BIRTH_DATE_FORMATTER)); + if (subjectResponse.getBirthDate() != null) { + accessTokenConditions.setDob(subjectResponse.getBirthDate().format(BIRTH_DATE_FORMATTER)); + } accessTokenConditions.setCoa(occurrenceInfo.getCountryOfArrival()); accessTokenConditions.setCod(occurrenceInfo.getCountryOfDeparture()); accessTokenConditions.setRoa(occurrenceInfo.getRegionOfArrival());