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());